[Talk-GB] OSM augmented reality project - affordable hosting recommendations or Overpass?

Roland Olbricht roland.olbricht at gmx.de
Tue Feb 5 16:59:48 UTC 2019


Hi,

> As an alternative, I was wondering how acceptable it would be to use the 
> Overpass API to obtain the data? Downloaded data would be cached on the 
> device so for a given area, data would only need to be downloaded once.

I'm fine with such a usage. The fine print is about other issues:

- Overpass API does support GeoJSON indirectly, but GeoJSON does not 
support EPSG:3857, see
https://tools.ietf.org/html/rfc7946#section-4

To get GeoJSON I suggest

[out:json];
way(south,west,north,east)[highway];
convert link ::=::,::geom=geom();
out geom;

where (south,west,north,east) is the bounding box.

As an act of courtesy I suggest to set the "Accept-Encoding: deflate, 
gzip" header and use

[out:json];
way(south,west,north,east)[highway];
if (count(ways) < 20000)
{
   convert link ::=::,::geom=geom();
   out geom;
}
else
{
   make error what="Too many ways in this bounding box";
   out;
}

This compresses the data and bails out if there are more than 20000 ways 
in the bounding box, corresponding to between 1 MB and 2 MB of data. 
Overpass would happily deliver about 1 GB per user and day, but the 
users may have data plans with rather 1 GB per month.

Thanks,
Roland



More information about the Talk-GB mailing list