For example: Is this place place_id="68487739" osm_type="way" osm_id="21854741" place_rank="26" boundingbox="51.7358468,51.7373514,8.7433035,8.7458768" lat="51.7361866" lon="8.7446936" display_name="Meisenweg, Paderborn, Kreis Paderborn, Regierungsbezirk Detmold, Nordrhein-Westfalen, 33102, Deutschland" class="highway" type="residential" importance="0.32" inside this relation https://www.openstreetmap.org/api/0.6/relation/73347 ? Edit: Precise description of the problem: How can I determine if a GPS-coordinate (latitude & longtitude) from any node is inside any self-contained relation/area/multipolygon? The area can be an existing boundary like "Regierungsbezirk Detmold" but it can also be a random multipolygon. asked 03 Jan '17, 17:48 AkeStrop |
[Answer edited, as the question has changed significantly] If you need to solve the general is a point "in" an OSM "area" for a larger number of points and areas I suspect the simplest way to do this is to import an OSM extract for the area in question in to a Postgis DB with osm2pgsql and then do spatial queries on the data. Or ... there are many alternatives, but they all (even if you simply roll your own code after reading a corresponding text) will likely require you to first actually create the geometry of the OSM "area" object in question, which in general is not something for the faint hearted so you should simply use something that is known to work. More details on your application and what you are really trying to do would help with a more specific answer. answered 04 Jan '17, 08:46 SimonPoole ♦ That's absolutely right and a really simple solution, but that's unfortunately not the solution for my problem. Let me be more precise and rephrase my problem: How can I determine if a GPS-coordinate (latitude & longtitude) from any node is inside any self-contained relation/area/multipolygon? The area can be an existing boundary like "Regierungsbezirk Detmold" but it can also be a random multipolygon. So your suggested solution don't solve the problem if it's a random multipolygon. I hope this describes the problem better.
(04 Jan '17, 14:13)
AkeStrop
|
are you looking for a solution for this case only or something automated?
No, nothing automated. Just a solution for this case would be enough ;)