0

I have a code for a challenge in Maproulette for Runways that are shaped as a polygon (not as a line).

this is Overpass code for making geoJSON file:

    [timeout:25];
area(3600304938)->.searchArea;
(
  way["aeroway"="runway"](area.searchArea);
);
out body geom qt;

Now the problem is Overpass filters all of runways for me (Polygon shaped and line shaped) , but I only want polygon shaped runways to load for me.

what should I do?

thanks

Mammadtri
  • 3
  • 2

1 Answers1

2

Unfortunately, checking for closed ways is currently not yet implemented, i.e. there's nothing you can do about this without further post processing, except for creating an enhancement request on Github maybe: https://github.com/drolbr/Overpass-API/issues

Edit: with the forthcoming version 0.7.55 you could count the number of members contained in a way and compare it with the number of distinct members. In case of a closed way, the first and last node will typically point to the same node id (that's why it's a closed way in the first place), hence we could use this difference of 1 between both values for a query.

Please note that there may be cases, where this heuristic does not work. That's why I still recommend to create an enhancement request for a proper closed way check. In your query area, I didn't find such cases though:

[timeout:25];
area(3600304938)->.searchArea;

way["aeroway"="runway"](area.searchArea)(if:count_distinct_members() + 1 == count_members());

out body geom qt;

overpass turbo link: http://overpass-turbo.eu/s/qLQ

mmd
  • 3,423
  • 1
  • 16
  • 23
  • 1
    The OSM help forum has a relevant question on identifying closed ways in an Overpass API query (same result, unfortunately). The answer over there includes some links to related GitHub issues: https://help.openstreetmap.org/questions/51255/overpass-query-how-to-select-unclosed-ways-that-have-no-tags – Tordanik Aug 01 '17 at 14:02
  • 1
    Right, that's my earlier answer on help osm. As the respective issue has already been closed without being fully implemented, please create a new issue for this use case in particular. – mmd Aug 01 '17 at 14:21