[OSM-dev] The OSM planet-sea and the global-ocean

Sandor Seres sandors39 at gmail.com
Fri Apr 3 16:44:55 UTC 2015

The OSM planet-land is created from the coastline dataset. From time to time
it might be reasonable to use the inverse of it, the planet-sea, or even
both of them. But, creating the planet-sea is not just a simple exercise.
Here is one model/option in bullets how this can be done efficiently.

-The first several steps are common. The coastline data is extracted from
the planet dump. So this set is processed by a data preparation chain to
remove replications, overlaps, corridor overlaps and the like. So, all
border polygons are created by linear connections of the processed coastline
polylines. Eventual gaps and open polygons are corrected, if possible.

-The next phase is the polygons-to-areas transformation. The result is a set
of simple areas where any outer/enclosing border polygon contains an
arbitrary number of hole/excluding border polygons. Simple areas with no
holes are primitive areas. The result is the planet-land and its creation
takes about 1h and 40sec on my laptop.

-The planet-sea might be created in the same way by adding the
universal/unit polygon before the polygons-to areas procedure. The universal
polygon/area is the rectangular polygon over the planet-frame (bounding
box). While the result, as an inverse of the planet-land, should be quite
correct, the procedure could take discouragingly long time. Here is one
highly efficient alternative.

-From the planet-land extract all primitive areas (polygons with no holes)
outside any holes. Add the universal polygon to the rest of the polygons and
run the polygons-to-areas structuring. Finally, revers the orientation of
the extracted primitive area borders and add them to the holes of the
universal polygon, to the largest area from the structuring. This process
takes about 45 sec on my laptop. Of course, the resulting
planet-land-INVERSED is exactly the same as in the mentioned standard
procedure. But, there is though one problem here.

-There are 13, and only 13, critical holes in the largest area, in the
global ocean, where certain border sections overlap with sections of the
outer border of the global ocean. According to the OSM documentation this
might be illegal. So, to be quite correct, do the last step.

-Remove the overlapping sections from the 13 holes and from the universal
polygon. Connect the remaining sections into a polygon and make it oriented
as an outer border. Finally, replace the universal rectangle with this large
polygon and eventually remove the 13 critical holes.

If interested, you may find the planet-land, planet-land-INVERSED and the
planet-sea here

IdUVYS0xTSURJdnlWQUZ5dy1PMVVVcTFLcmc&usp=sharing> &usp=sharing

created from the latest OSM dump. The tiled versions are added for practical
reasons. You can download and use them as you like but please respect the
OSM licencing roles.

Regards, Sandor.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20150403/992aa074/attachment.html>

More information about the dev mailing list