mvexel / meetyourmappers

Find other OpenStreetMap mappers around you
MIT License
27 stars 3 forks source link

Make data retrieval less greedy #12

Open mvexel opened 5 years ago

mvexel commented 5 years ago

Currently we retrieve data greedily using these queries:

https://github.com/mvexel/meetyourmappers/blob/master/meetyourmappers/views.py#L13-L14

This results in 'stray' data being considered due to recursion. Here's a pretty extreme example, the actual bounding box was a pretty small area around Bow, East London:

screen shot 2018-09-01 at 9 29 59 am

@mmd-osm what would be a non-greedy alternative that would clip data to exactly what is inside a bounding box or an OSM area boundary?

mmd-osm commented 5 years ago

I think you could try a query based on the /map call, which assures that all nodes and ways inside your bbox are contained in the result: https://github.com/drolbr/Overpass-API/blob/master/src/cgi-bin/map#L27:

That's: (node({s}, {w}, {n}, {e});way(bn);node(w););(._;(rel(bn)->.a;rel(bw)->.a;);rel(br););out meta; or: (node(area:{});way(bn);node(w););(._;(rel(bn)->.a;rel(bw)->.a;);rel(br););out meta;