[OSM-dev] Coastline polylines to land polygons

Sandor Seres sandors39 at gmail.com
Sat Sep 15 11:24:01 BST 2012


As I can see this is a frequently discussed subject. The interest for the
subject is especially high when doing streaming based mapping. I am one of
these and doing the coastline-to-land conversion process frequently. So,
let me allow a few related notes.
If interested, you  can find (and download) the planet_land (area) files,
based on OSM coastline source data just from a short wile ago. The link is
here
https://docs.google.com/folder/d/0B6qGm3k2qWHqb0xnLUVKc0ZyMzQ/edit
Careful, some of the polygons are really huge. The source data consists of
27 787 840 points/nodes in 685 610 polylines. The conversion is a chain of
processes:
-LatLong to the usual Mercator projection.
-Formal error detection and reparation. The number of errors was
15, surprisingly low, excellent.
-Defragmentation, or polylines to polygons transformation. There were some
replicated polygons and points. These were ignored. The number of polygons
is 455 636 and the number of points is 27 555 018.. There is no structure
in this set of polygons. Any semantic relational tags are ignored.
-The final process was the polygons to areas transformation/structuring.
The area structure detection is topology/geometry criteria based. Anyway,
the topology is here overriding any other criteria. The number of areas is
455 398. These areas are in the planet_land file. Otherwise, the vector
structure is the same as in the original data.
Now, this area file may be (and is) subject of many further actions. In
bullets:
-Inversion to planet_sea data. This, to make more effective streaming based
client rendering (we mostly pan, zoom, rotate ... in land areas so this is
the background color). Note that this is not necessary if you use a robust
scan-line based fill (compared to a polygon based algorithm).
-Scale/zoom level generation by vector smoothing and data reduction, These
levels allow continuous scaling and a radically low data size
to transmit to clients. An example of a such level is also reachable by the
given link. It is supposed to be used for scales between 1:90 000 000 and
1;180 000 000 (for other scales other levels are used). It contains only
6898 points.
-Finally the global tiling (or generating of large tiles). The local (or
small) tiles for transmission are generated on-the-fly. Now, such tiled
data is loaded into a DB (if needed at all). Scale levels combined with the
tiling allow compact data formats and radically reduced data size per km**2
equivalent (just several kB) in transmission.
Thanks for your attention.
Sandor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20120915/d6f8fb88/attachment.html>


More information about the dev mailing list