[OSM-talk] How to fix wonky coastline?
David Earl
david at frankieandshadow.com
Wed Feb 28 18:47:08 GMT 2007
> -----Original Message-----
> From: talk-bounces at openstreetmap.org
> [mailto:talk-bounces at openstreetmap.org]On Behalf Of Robert Hart
> Sent: 28 February 2007 18:25
> To: Steve Bromwich; talk at openstreetmap.org
> Subject: Re: [OSM-talk] How to fix wonky coastline?
>
>
> Steve,
>
> In general the coastlines in the OSM database have been defined as
> lines, but are currently being treated as areas by the Mapnik renderer.
> This will inevitably lead to the results you are seeing, and the only
> fix will be an update to Mapnik, or a re-think of how to represent very
> large areas in OSM.
>
> I wouldn't try and "hack" a solution, as that may not be the best
> solution in the medium term.
>
> Rob
As I think I've said before, I think the easiest way deal with coastlines
efficiently is to define that the sea is on one specific side. That way
renderers can determine where the sea is based on purely the bit of the way
that falls within the area they are trying to render.
It would mean correcting coastlines already present.
I think it should be possible to do make heuristic decisions about which
side is sea presently: for example finding a near (non-bridge) highway to a
coastline way (on the assumption that non-bridge highways are always on dry
land!) and determining which side they are on relative to that bit of coast
(construct a line from one of the highway nodes to one of the nodes of the
coastal way, counting intersections with any coastal ways between -
essentially a point in polygon test, eve though it isn't really a polygon).
While this could be done by a renderer it is not very helpful for tiles
where the nearest road is a long way off the tile, but it could also be used
to automate the correction of coastline direction for ones which are
currently against the rule I am proposing, so a one-off task.
The renderer merely needs to close up the sea area by adding pseudo segments
between the ends of the coastline where they intersect with the edges of the
tile (or use the nodes off the edge of the tile) around the tile edges in
the direction indicated by the rule.
This allows all rendering of sea decisions to take place locally to the
tile.
David
More information about the talk
mailing list