1

Currently i use the overpass api to query for "leisure=playground" ways and nodes to display them on a map in a webapp.

The problem is, first of all its very slow (even with querys limited to a high zoomlevel) and i query dynamically based on the currently displayed map. Which leads sometimes to multiple querys in a short time, when the user drags the map around. This querys often get blocked, because of "too many querys".

The only solution i found so far is: Download the OSM data, filter them locally and upload the filtered data in a DB or to the maptile provider. But to keep the data up to date i would have to do this on a regular basis. This seems to be very inefficient.

Is there any (free or paid) services, which gives fast results on OSM data querys? I wouldnt mind if the data is a few days old, but it should be updated regularly.

Whats the best practice to build some kind of an OSM-Interface for a special type of location?

Update

Example query:

http://overpass-api.de/api/interpreter?data=[out%3Ajson]%3B%0A%28%0A%20%20way%0A%20%20%20%20[%22leisure%22%3D%22playground%22]%0A%20%20%20%20%2840.72781164387366%2C-74.19745445251465%2C40.76032570468407%2C-74.09960746765137%29%3B%0A%29%3B%0Aout%20center%3B

which is

[out:json];
(
  way
    ["leisure"="playground"]
    (40.72781164387366,-74.19745445251465,40.76032570468407,-74.09960746765137);
);
out center;

~3 seconds for 5 ways (directly executed in the browser

It is used in a MeteorJS project. But i don't see any major differences with different frameworks.

  • 2
    Overpas API is already incredibly fast considering the huge amount of data available in OSM. If you need a faster instance then consider installing your own one. – scai Apr 18 '16 at 6:42
  • 2
    How do you define "very slow"? Can you post your query (including typical bbox), which overpass api instance you currently use, the response time you're seeing as well as the response time you're expecting. Any framework you use to run the queries? Otherwise, it will be very difficult to provide some advise. – mmd Apr 18 '16 at 12:04
  • You can still merge both accounts: gis.stackexchange.com/help/merging-accounts – AndreJ Apr 19 '16 at 9:03
  • ok, sorry... didn't know it was the same account after all. Maybe you can try another overpass instance: overpass.osm.rambler.ru/cgi - I get about 420ms response time for your query at the moment. – mmd Apr 19 '16 at 10:07
  • If overpass-api is so bad it seems that you either need to optimize your program or maintain your own database. – Mateusz Konieczny Jan 9 '18 at 15:55
1

taginfo counts 104000 nodes and 206000 ways tagged with leisure=playground. That is not a very huge amount of data, but you should query both data types. It would be best to prefetch them, put them in an extra database, and let the users query that online. You could build centroids on the closed ways to reduce the data amount.

If the data can be "a few days old", you can split the world in three or four parts, prefereably rectangle bounding boxes, and query these with overpass on a weekly scheme.

Or download geofabric extracts of continents, and run an osmfilter query on that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.