NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi All,

I'm having a bit of trouble running queries for areas that are within other areas. For example:

area
  [name="United States of America"]
  [border_type=national] -> .usa;
(
  area
    (area.usa)
    [admin_level=4]
);
out 100;

I would expect this to return a list of states in the US. However, what I actually get is a random hodgepodge of areas with admin_level=4, not just those in the US. Am I misunderstanding the area syntax?

asked 07 Mar '14, 04:15

sib's gravatar image

sib
6111
accept rate: 0%


There are two different problems entangled:

Overpass API doesn't support to query for areas in areas. It is just not implemented, but you could get a similar result with the query

[timeout:3600];
area
  [name="United States of America"]
  [border_type=national] -> .usa;
(
  rel
    (area.usa)
    [admin_level=4];
);
out 100;

It is unfortunately really slow.

Second, there are a lot of relations (and thus areas) tagged with "admin_level=4" although they are not states. One example is relation 80297 which is a park somewhere in Ohio.

permanent link

answered 07 Mar '14, 10:03

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

Unfortunately, it is not yet possible to search for areas inside other areas. See this ticket on github. :/

permanent link

answered 07 Mar '14, 08:49

tyr_asd's gravatar image

tyr_asd
1.2k51927
accept rate: 64%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×65

question asked: 07 Mar '14, 04:15

question was seen: 4,693 times

last updated: 07 Mar '14, 10:03

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum