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

Select only closed ways in Overpass turbo wizard

3

In Overpass wizard one can say: type:node|way|relation What about type "closed-way"? What's the syntax? Thank you, RB

asked 22 Oct '17, 09:42

bapman's gravatar image

bapman
71337
accept rate: 0%

edited 22 Oct '17, 16:34


One Answer:

3

https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Closedness - use the operator is_closed()

For example, this finds all closed ways with leisure=fitness_station

[out:csv(::count)][timeout:60]; ( way ["leisure"="fitness_station"] (if:is_closed()) ; ); out count;

See https://overpass-turbo.eu/s/LMB

For unclosed ways, add ! before is_closed, eg:

[bbox:{{bbox}}] ; way["area"="yes"](if:!is_closed()); out geom;

answered 24 Aug '19, 08:52

Joseph%20E's gravatar image

Joseph E
3902615
accept rate: 15%

edited 24 Aug '19, 09:00

Source code available on GitHub .