OSM Waterway analyses

This check creates listings of all OpenStreetMap waterway relations.
The waterways are listet in flat and hierarchical order. One tree of such a hierarchical waterway list is a watershed.

The script (see. technical details) also traces all connected waterway way segments.

Results for different areas

For the whole planet: flat list, hierarchical list, hierarchical list with wikidata

For all contries see last column of this wikidata/osm list

The results can be used to improve osm data and wikidata objects. While fixing some missing connections, I've seen different reasons, why two waterway relations are not connected:

technical details

Two ways are connected by nodes. The flow direction can be determind by the position of the connection nodes in the way.
Example: The endpoint of one waterway is connected to the start or mid point of a second waterway. Thus way one flows into the second waterway.

With that information you can create a table with all flow direction information of the ways.

With that, you can find out which waterway relation flows into another.

And finally traverse the connected waterways and build wateshed trees.

Sources

You can find the source code on github: https://github.com/werner2101/osm-tests

ideas for improvements


Werner Hoch
Last modified: 2019-12-28