This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Combining coastlines for rendering

2

I'm writing simple rendering for OSM maps, and I have found that lands border is not one polygon but multiple coastline ways. So my question is how to combine them to one path for rendering? Is there some criteria for combining ways or it is done through relations?

asked 05 Oct '11, 14:49

pastorgluk's gravatar image

pastorgluk
31114
accept rate: 0%

edited 05 Oct '11, 17:53

Jonas_'s gravatar image

Jonas_
662152233


2 Answers:

7

I strongly recommend these wiki pages:
https://wiki.openstreetmap.org/wiki/Coastline
https://wiki.openstreetmap.org/wiki/Coastline_error_checker

It's explaining how coastline rendering works, why we need special tools to monitor them in OSM and the different type of errors we can find.
But two simple rules to remind : coastlines are not assembled with 'relations' and ways tagged with "natural=coastline" have the "water on the right". You may find many coastlines being part of relations but this is mostly for administrative boundaries, never for the coastline itself.
Saying that, the solution for you will depend on which zoom level(s) your simple renderer works. You might also have a look on how the application mkgmap (converting OSM data to Garmin GPS) is generating sea polygons.

answered 05 Oct '11, 16:58

Pieren's gravatar image

Pieren
9.8k2083157
accept rate: 15%

edited 05 Oct '11, 16:59

1

One starting point can be here in the OSM wiki:

Coastline

answered 05 Oct '11, 16:56

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Source code available on GitHub .