Compute river basins based on OSM data.
Java CartoCSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Compute river basins based on OSM data.

This tool is intended to create maps of river basins like Flussgebiete Deutschlands.


  • Linux 64 bit (eg. Ubuntu 12.04)

  • Java JDK 1.6, Ant, Ivy

  • Osmium fork from skaringa

  • Tilemill


  1. Compile Osmium/osmjs. See OSM wiki to get started.

  2. Compile rivers:

     ant -lib /usr/share/java
  3. Download germany.osm.pbf file from Geofabrik. Generally the tool should work with other regions as well, but in that case you probably need to add more names and IDs to

  4. Run osmjs to create shapefiles and CSV files with config_rivermap:

     osmjs -2 -m -l sparsetable -i osm2shape.js -j js/config_rivermap.js germany.osm.pbf
  5. Run rivers with the CSV files generated by osmjs to build the river basins:

     ant -lib /usr/share/java -Dargs="wways.csv wtr.csv rsystems.csv"  RunRiverSystems

    This creates the CSV file rsystems.csv that contains the mapping of the OSM way ID to the name of the river basin.

  6. Merge this CSV file into the waterways shape file:

     ant -lib /usr/share/java -Dargs="waterways.shp rsystems.csv waterways-r.shp" RunJoinCsv

    Alternatively you may use other tools, like Quantum GIS to merge CSV and shape file.

  7. Use tilemill to render, customize, and export the map.