I am given a ISO 3361 Alpha-2 country code and a location name. I'm trying to use Overpass to extract the geometries (or boundaries, or polygon) of that location. I don't know the location's specific administrative level (i.e. it could be a town, a city, a county, etc..., but not any lower resolution/division than that). For example: Tried the following query, but got way more data than I need: or So what is the best way to extract this data? Thanks! asked 31 Jan '21, 13:29 RamidAshar |
2 Answers:
One way is to use explicit steps to fetch the ways and nodes instead of
The answered 31 Jan '21, 15:22 maxerickson interesting. yes, it works. I got only the boundaries I needed. 1. Also, limiting to (31 Jan '21, 17:43) RamidAshar admin_level=4 is not for cities, so you'd have to do more than remove the name. (31 Jan '21, 18:55) maxerickson @maxerickson For some reason, back in 2012 This relation was defined as place=state (06 Feb '21, 06:06) DaveF Yes, it's a reflection of the political organization of Berlin. https://en.wikipedia.org/wiki/Berlin#Government (06 Feb '21, 15:41) maxerickson |
Have you got 'Don't display small features as POIs.' under Settings>Map turned off? Checking only for relations will return only relations & speed the search up a bit.
PS Could you use the Code button when posting a routine. It makes it easier to read & copy/ppate/ answered 06 Feb '21, 05:06 DaveF |
Was "some more nodes" just the admin_centre node or actual nodes of the relation? Explain what "projected it on map" means? What map? uMap?
yes, thats probably it (the admin_centre), but even more nodes in some weird places (some in the middle of the city, some on the boundaries). I converted to GeoJson and put it on kepler.gl for instance. maxerickson's answer seems to solve this issue for me.