1

I would like to create a web map showing just one type of point of interest. They are made available via the Overpass API and count up to only few thousands for the whole world.

I don't expect them to change at all, they will at most slowly increase in number (they represent some very expensive equipment).

According to all the above, I thought to export all of them manually, store them as a JSON file that gets shipped to the clients when they connect for the first time. In some months I will redo the procedure and update the data.

I was able to implement this scenario using a very small subset of data. Now I would like to export the whole data set. How should I do?

  • Are you creating the JSON manually? And how are you querying the data? – Marcelo Villa-Piñeros Jul 9 '19 at 15:38
  • ATM I queried the overpass api via web asking JSON as output. But I'm open to all kind of alternatives – leonixyz Jul 9 '19 at 15:42
  • Can you paste the query you are using? – Marcelo Villa-Piñeros Jul 9 '19 at 15:45
  • I cannot paste the actual query, but it is similar to this one, except the tag is different [out:json][timeout:25]; ( node["amenity"="hospital"]({{bbox}}); ); out body; – leonixyz Jul 9 '19 at 15:51
1

If you want to export the whole dataset you have to remove the {{bbox}} parameter.

Imagine you were exporting waste transfer stations (which are not as common as hospitals).

The following query will export all waste transfer stations inside the bbox:

[out:json][timeout:60];
(
  node["amenity"="waste_transfer_station"]({{bbox}}); 
); 
out body;

However, if you remove the bbox it will return all the waste transfer stations:

[out:json][timeout:60];
(
  node["amenity"="waste_transfer_station"]; 
); 
out body; 

Furthermore, if you wanted to automize this process you could use Python and requests to get the data programatically. Feel free to ask another question if that is the case and I will gladly answer it.

| improve this answer | |
  • 2
    I would highly recommend to check the number of objects via taginfo.openstreetmap.org before running this sort of query. Anything above a few thousand objects will most likely create too much load on the public instances. If you see more than say 50k entries, you should definitely use a bounding box, or if you still need the whole planet, download a planet file from planet.openstreetmap.org instead. – mmd Jul 9 '19 at 19:49
  • @mmd Yeah, you are right. Although he said it has only a few thousand objects. An alternative could be dividing the planet into quadrants and making a query for each quadrant, waiting a couple minutes in between each query. – Marcelo Villa-Piñeros Jul 9 '19 at 20:52

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.