[OSM-talk] How to fix wonky coastline?

David Earl david at frankieandshadow.com
Wed Feb 28 21:03:44 GMT 2007


>
> > 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).
>
> This will never work reliably.


Actually, thinking about it further, in principle you only need to identify
one such point, and could do so manually), and all the coastlines could be
dealt with from that. Once you know one point on land, you can identify
which side of the coastline the land is on from that. Though it might reduce
computation somewhat to work with a more significant set of known land
points.

It doesn't need to be done in the database, it could be run over planet.osm
to determine the changes needed.

Polygons just complicate the issue - you can't just draw a line round the
coast when you introduce a new island, you have to labriously create lots of
polygons which go some way out into the sea or divide up the land.

There is, incidentally, whether sea polygons or linear coastline is used, a
remaining problem of how to know whether a tile which does not have any
coastline is on land or not. If someone creates a node in mid atlantic with
no tags so it forces it to render, would it show up as sea?

David







More information about the talk mailing list