I'm using the Overpass API to pull data from OpenStreetMap. The web version that I use to verify queries before running through my process against the API is Overpass Turbo. This is the query I'm using to collect all places that are Admin Level 8 within California:
That doesn't return all items, though. For example, Pacifica is not included. Is that a problem with Overpass, or is there something wrong with my query? asked 25 Oct '15, 20:26 JamesChevalier |
Pacifica is a way. So you need to also have a way query (or just use an area query).
or the mostly equivalent (mmd points out in a comment that this won't work as it is not implemented):
I guess the area query will probably be cleaner, as it will only return closed polygons (depending on what's in the data, there might be a bunch of ways that aren't closed areas). answered 25 Oct '15, 20:57 maxerickson mmd 1
Bottom line: you have to stick to rel...(area) / way...(area) for the time being.
(25 Oct '15, 21:05)
mmd
2
The biggest issue is that it will probably return ways that are parts of the relations (but with any luck you will be able to discard those by checking for things like 'name').
(25 Oct '15, 21:14)
maxerickson
3
@maxerickson: I had to adopt your initial proposal, as it also didn't work as expected: you need to store the area in an inputset (here it is called
(25 Oct '15, 21:21)
mmd
1
Thank you! Thank you! Thank you! You both just helped me out so much. In case it's at all useful to anyone, I've been storing the individual cities that I'm using in my project in github: https://github.com/JamesChevalier/cities
(25 Oct '15, 21:32)
JamesChevalier
1
Oh wow, I just realized how critical that last
(25 Oct '15, 21:53)
JamesChevalier
|