This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Would like to extract all the waterways in Europe

1

Hello, I would like to extract all the waterways in a large extent including Europe using Openstreetmap API capabilities. Eventually I would like to include this in a python script. However running it directly through overpass API or one of the openstreetmap-provided mirrors would be the first step in this process.

I tried running the following through Overpass

way(35.359872101102724, -29.628211426818392, 70.90180289857001, 47.014599265244506)["waterway" = "river"];
out;

But got an error:

runtime error: Query ran out of memory in "query" at line 1. It would need at least 531 MB of RAM to continue.

I then tried prepending the above with [maxsize:1073741824]; and then running, but I still got the same memory error.

How can I extract this data and avoid the memory errors? Thanks

asked 25 Oct '18, 13:14

awa5114's gravatar image

awa5114
46226
accept rate: 0%


2 Answers:

3

This clearly outside of the scope of any of the public Overpass API servers. You should simply download an OSM data extract for Europe and extract whatever you want from that, for example with osmfilter https://wiki.openstreetmap.org/wiki/Osmfilter or one of the other tools available.

answered 25 Oct '18, 20:39

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Indeed that is what I have tried to do. I currently have downloaded several files from the GeoFabrik website: euriope-latest.osm, europe-latest.osm.pbf and albania-latest.osm. I also have all the command line tools osmconvert, osmfilter and osmosis. I have tried various queries on all of them but it takes a very long time, and there is no way of judging how long it will take. Do these query tools provide any possibilities in terms of extracting large datasets aside from just getting it all at once?

(26 Oct '18, 10:19) awa5114

0

You might also need to include more tag options. I found that to get all the navigable waterways in the UK, I also needed

  • water=river with boat=yes
  • waterway=canal with boat=yes
  • waterway=river with boat=yes

I did it with overpass, in about 8 manual slices- probably not an option for all of Europe.

This answer is marked "community wiki".

answered 06 Nov '18, 21:56

spiregrain's gravatar image

spiregrain
1838815
accept rate: 0%

Source code available on GitHub .