Overpass-API icon indicating copy to clipboard operation
Overpass-API copied to clipboard

Uncertainity using `map_to_area` when analyzing playgrounds

Open ltog opened this issue 4 years ago • 5 comments

I try to analyze playgrounds that have been micromapped using playground=* tags inside them.

I wrote the following query to achieve this.

[out:json][timeout:60][bbox:{{bbox}}];

wr[leisure=playground];

map_to_area -> .pgs;

nw(area.pgs)[playground] -> .equips;
.equips out; .equips >; out geom;

(see https://overpass-turbo.eu/s/1aTs )

I expect that it also would return playground=* elements from the two playgrounds in the south east. Why doesn't this happen? Is my query erroneous (quite probable) or is this a bug in the Overpass API (probably not)?

ltog avatar Sep 04 '21 19:09 ltog

This issue seems to be a duplicate of #77. Unfortunately, the official Overpass instances don't support this scenario yet.

In the meantime, you can use this prototype: https://overpass-turbo.eu/s/1aTz or this one: https://overpass-turbo.eu/s/1aTA

mmd-osm avatar Sep 04 '21 21:09 mmd-osm

In the meantime, you can use this prototype: https://overpass-turbo.eu/s/1aTz or this one: https://overpass-turbo.eu/s/1aTA

@mmd-osm : That seems to work fine. Thank you! :-)

However, I still don't understand why the results of my original query differ between different playgrounds. Shouldn't all of them return results (or none of them)?

ltog avatar Sep 05 '21 19:09 ltog

It has to do with area creation rules on the server.

A few links worth reading:

  • https://dev.overpass-api.de/overpass-doc/en/full_data/area.html#background
  • https://wiki.openstreetmap.org/wiki/Overpass_API/Areas
  • https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features give some ideas how ways and relations are selected for area creation. If your object isn't part of that selection, it won't show up as a result of map_to_area (or any other area[...] statement).

mmd-osm avatar Sep 05 '21 19:09 mmd-osm

You can also have the opposite kind of query, finding playgrounds without micro-mapping: https://overpass-turbo.eu/s/1bkE

mmd-osm avatar Sep 20 '21 16:09 mmd-osm

For ways, the problem has been solved by version 0.7.57.

drolbr avatar Oct 22 '21 12:10 drolbr