3

Is it possible to download openstreetmap by direct link through http://overpass-turbo.eu without removing any data?

Basically I am trying to download the openstreetmap data with defined boundaries in the same way that it is currently possible through openstreetmap.org:

http://api.openstreetmap.org/api/0.6/map?bbox=11,50,11.1,50.1

It's just the output should be .geojson instead of of .osm.

I am not sure I understand the Overpass API syntax. I need something similar to this:

[out:json];
node(11,50,11.1,50.1)
out body;

But how should I make the download link from it (assumed the upper syntax is correct, which it isn't)?

https://overpass-api.de/api/interpreter?data= [out:json](48,11,48.19,11.73)... ?
5

See the Overpass API Language Guide. Basically you seem to want all data in a bounding box. Depending on your use-case you might want to download nodes, ways and relations.

overpass turbo already has a preset for this. Just go to Load and select Map Call. The resulting query is:

[out:xml];
(
  node({{bbox}});
  <;
);
out meta;

Change xml to json to change the output format. This corresponds to the following Overpass API query:

http://overpass-api.de/api/interpreter?data=[out:json];(node(11,50,11.1,50.1);<;);out meta;

However json is just json and not geojson. There are various converters around on the Internet though. overpass turbo also includes one if you go to Export.

Remember that overpass turbo is just a front-end to Overpass API, usually you don't really need it except for playing around and visualizing the results.

For larger areas consider downloading one of the country or area extracts.

  • Thank you again for the reply @scai. Ah, I was not aware of the fact that json is not the same as geojson. Thank you. I can not click on Export I need direct link download. How do I get the direct download link for the syntax you gave me? To my knowledge neither of the Country and area extracts does not support direct download through url. One needs to click at least on something. – marco Jul 23 '16 at 19:54
  • Clicking on Export allows you to view the URL for downloading raw data. Not sure what you mean with "Country and area extracts does not support direct download". download.geofabrik.de for example has direct download URLs you can use. – scai Jul 23 '16 at 19:56
  • I learned something new again (about the url of the downloading raw data). I need to download the data according to the openstreetmap bounding box boundaries. download.geofabrik.de does not allow that. This is what I meant. – marco Jul 23 '16 at 20:02
  • 1
    Thank you @scai. I owe you a beer for all of this help you gave me. – marco Jul 23 '16 at 20:36
  • 1
    I'll take you up on that :) – scai Jul 23 '16 at 21:15

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.