This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Trouble querying Overpass for footways in national parks

0
1

I'm trying to query Overpass for trails and paths within nature reserves. My query seems to work fine in some nature reserves but not others. I have been querying in Maryland, USA. Specifically, I have noticed that it does not work in either of these national parks: Catoctin Mountain Park or Chesapeake and Ohio Canal National Historical Park. Can anyone tell me what I am doing wrong? Here's my query:

https://overpass-turbo.eu/s/1u8o

asked 24 Apr '23, 00:36

sillyboy22's gravatar image

sillyboy22
16112
accept rate: 0%


One Answer:

1

nature_reserve as ways are automatically converted to 'areas' in Overpass' database. Unsure if it's intentional, but relations aren't. Add map_to_area; to force a conversion

https://overpass-turbo.eu/s/1ua9

wr[leisure=nature_reserve]({{bbox}});
map_to_area;
wr[highway~"^(footway|path|track)$"](area);
out geom;

answered 24 Apr '23, 15:04

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 24 Apr '23, 15:25

Very helpful. Thanks!

(24 Apr '23, 15:11) sillyboy22

Source code available on GitHub .