Hi, I have an overpass API that retrieves me all the ways and nodes of the admin level 2 boundary for a given country. My example is Spain. area["ISO3166-1"=ES];(rel(pivot);nw(r);node(w););out; I postprocess the data I get from this and end up with 21 closed polygons. One of the polygons is made up of just one way: Way ID = "46430215" Which I believe is the maritime border for the island of Ibiza. There were no tags on the <way> though that told me this. I had to work it out manually using a totally unprogrmatic approach. My ultimate aim is for a user to pick a location by long lat and then find out where this is. For this though I need to get polygons and check if the point is in a polygon. If it is, I need to tell the user something useful about the polygon like what it is called. So how can I get information like this is an island and it is called Ibiza from OSM? the user could equally well of course chosen a point in the middle of mainland Spain or the Meditterranean Sea and I would want to give them relevant answers for these as well. Any guidance on the approach I can use is most welcome, Chessel asked 29 Dec '23, 15:25 Chessel |
There probably wouldn't be tags on the way if it exists just to be part of a boundary relation. A more general overview of how boundaries are recorded is here on the wiki. Whether the way is part of a hole in the area or an outline would depend on the role it had within the relation, which is also stored in the relation. Overpass has an It sounds to me like you might want reverse geocoding for a point you query. There are some existing geocoders that might get you something close to what you want with less effort. answered 24 Jan, 23:46 InsertUser Thanks for your reply. I've been on a bit of a journey of discovery with OSM and my understanding of how to use it is improving. Thanks for your links. I now know what areas are and what reverse geotagging is having done that reading. Many thanks.
(25 Jan, 09:39)
Chessel
|