[OSM-talk] How to fix wonky coastline?

David Earl david at frankieandshadow.com
Thu Mar 1 00:20:21 GMT 2007

> > It is just so much simpler for the renderer to make decisions
> at the same
> > kind of scale as what it is trying to render.
> Not sure how it is much simpler than just render a polygon.

If the polygons are explicit, then they are unlikely to be the correct size.
Too small and small scale maps will run out of sea before you get to the
edge of the map you are trying to render; too large and they are too big in
relation to a small area you are trying to render, so you have to download a
lot of irrelevant coast.

Furthermore, if you have to create explicit polygons manually, it is a
massively time consuming procedure. And to do it automatically you have to
know which side of the existing coastline you're on, which comes back to the
original problem, and in either case you have to take neighbouring
shorelines into account.

Creating an appropriately sized polygon on the fly is admittedly somewhat
harder than filling an existing polygon. But it is a well understood
problem: it is a standard clipping algorithm. I think osmarender could do it
very simply by passing the buck to the svg interpreter. But it is guaranteed
to cover the whole of the relevant area (with the minimum of downloaded
data) and most importantly doesn't require any manual work to create
explicit polygons each time a new coastline is added.

Further still, a collection of polygons doesn't give any accessible
information about whether a random point is on sea or land. Though it is
still tricky, you can in principle work it out if you have a definitive edge
of the land, rather than just isolated 'pools' of water for drawing purposes
beyond which is ... what?

I just don't think a series of polygons along a coast can ever work
properly, except in certain special cases at a scale appropriate to the
polygons and then only for renderers. Because they don't represent the
boundary, but introduce artificial edges, you no longer have any idea
computationally where the actual shoreline is. And representing the whole
world's sea coast by a single massive polygon (plus few landlocked seas)
will make impossible demands on the database and renderers.


More information about the talk mailing list