OpenStreetMap

Deep Dive: natural=coastline

Posted by bdon on 28 December 2019 in English. Last updated on 29 December 2019.

I have made several edits around the world related to the OSM coastline. My goal is to enable small-scale derivation of land and ocean polygons without resorting to global preprocessed continent geometries assembled from programs like OSMCoastline.

As a primer, the coastline should be mapped as ways with natural=coastline, with land on the left side and ocean on the right side. This is specified on the OSM wiki: Tag:natural=coastline. “Land” in this instance is defined as the non-ocean parts of the world, not solid ground in general; for example, the Great Lakes are represented not by coastlines but as water body features inside “land”.

There are a few implications to this design:

The ocean should be one polygon in the OGC Simple Features sense: it has one outer ring in the clockwise (CW) direction, and a counter-clockwise (CCW) inner ring for every continent and island. The Caspian Sea is the one exception to this single polygon as stated on the Wiki.

The complement of the global ocean polygon is thousands of land polygons representing continents and islands. Each polygon has a single CCW outer ring and zero inner rings. Again, the one exception is that the Eurasian continent polygon has a CW inner ring representing the Caspian Sea.

In theory, this specification should be enough to infer land and ocean polygons from orientation even within a small geographic extract. I discovered and corrected several dozen places where a violation of this specification arises. The image below is an example of data that needs to be corrected:

example error

These problems are sometimes simply mistagged islands within inland water bodies (Changeset 78960812), but can arise even when mappers are mindful of oceans and way orientation. From edit histories this seem to happen because:

A mapper correctly adds island A based on satellite imagery. Years later, a mapper has access to higher resolution imagery and adds island B (way 677293895). However, B is wholly contained within A: the ocean defined by B’s boundary contradicts the land defined by A’s boundary.

example island in island

Changeset 78947512 : A case where a hydrological feature has been changed from part of the Single Ocean Polygon to a more detailed object, such as a river delta, estuary or bay multipolygon. The outer ring of the Single Ocean Polygon recedes, but now its islands are no longer contained.

example new multi

I have corrected most occurrences of this problem as of December 2019, which should enable more flexible land and ocean mapping from raw OSM extracts! Inevitably these issues will crop up again as the global coastline is better digitized, so I hope this post can help mappers fix them.

Location: Clinton Hill, Brooklyn, Kings County, New York, 11205, United States

Discussion

Comment from Warin61 on 29 December 2019 at 08:12

I’d think ‘land’ does not include waterways, lakes etc. Using the coastline to define ‘land’ would include these water features. Many coastlines do not follow rivers ‘inland’ but have simple lines across their mouths to define the coastline. As an approximation it works .. but at a fine scale it misses things.

Comment from bdon on 29 December 2019 at 15:28

Yes, in this case “land” should be interpreted as non-ocean shapes; most freshwater areas are and should be mapped on top of this “land”. I’ll edit the post above to clarify this.

Comment from giggls on 29 December 2019 at 16:58

OSM Inspector provides a Coastline view https://tools.geofabrik.de/osmi/ generated from the osmcoastline process producing the data available at https://osmdata.openstreetmap.de/

Comment from bdon on 29 December 2019 at 17:03

@giggls I don’t believe that the Coastline checker tool you link catches this class of error right now, though it may be possible to add an automated check for it by doing point-in-polygon tests.

Comment from bdon on 29 December 2019 at 17:04

One area that I haven’t attempted to fix is the area around this delta: https://www.openstreetmap.org/way/677293895#map=19/2.54713/-78.40208 which requires tracing new coastlines. It doesn’t appear in the OSM inspector view.

Log in to leave a comment