I've extracted some National Parks from Openstreetmap. But now I want to find out where the entrances are. Openstreetmap has some tags for it but it isn't used that often. So I tought: An entrance into a national park is a road which crosses the border of that park. Must be true: You are going into the park. The only downside I can think off is that it could be a private road for staff or something but that should be a small percentage. So what is the best ways to find these points? My guess: I know the boundaries of the park. So I can download all roads in that park. Then I can use the "Ray casting algorithm" for all sections of all roads in the parks to see if it crosses a border. When it does: that is a road that goes into the park. However, that might be very slow. If you have a large park with lots of roads inside it, it might take ages to check all segments. Is there a more clever way? asked 10 Aug '15, 11:23 NLAnaconda mmd |
Here's an Overpass API solution for it: it will find all ways, which intersect with boundary=national_park relations: Try it in overpass turbo! link Just navigate to the area you're interested in and hit "Run". There's no need for a local DB or any other download. answered 10 Aug '15, 15:01 mmd This works great! One question: Some roads are the border/on the border. They light up as bordercorssing but some dont really go in the park. Is there a way to exclude these roads?
(10 Aug '15, 16:22)
NLAnaconda
1
Can you please try the following query: http://overpass-turbo.eu/s/aSN - this one should exclude highways which are part of the boundary relation itself. A detailed explanation for this query can be found on the linked stackoverflow page.
(10 Aug '15, 20:40)
mmd
I guess that some roads are on the boundary without being part of the boundary (like its an extra layer) Some are still highlighted. For example this one (north east) on Kruger National Park: http://overpass-turbo.eu/s/aSO
(10 Aug '15, 21:43)
NLAnaconda
1
Way 327080110 seems to be on the border. However, if you zoom in a bit, you'll notice that it actually crosses the border somewhere near node 3337923111.. that's why this way is also included in the result.
(11 Aug '15, 10:10)
mmd
You are right. Sorry. I think I can filter these roads out when I check if they have a node further into the parks.
(12 Aug '15, 00:35)
NLAnaconda
|
You could filter an OSM data file (e.g. for the whole planet or a region you care about) using I don't know how slow it is, depending on the size of the data, that might be fast enough. answered 10 Aug '15, 13:25 rorym |
crosspost: https://stackoverflow.com/questions/31909933/openstreetmap-get-all-entrances-in-a-park