[OSM-dev] 0.6

Martijn van Oosterhout kleptog at gmail.com
Wed May 7 07:18:42 BST 2008

On Wed, May 7, 2008 at 12:08 AM, Iván Sánchez Ortega
<ivan at sanchezortega.es> wrote:
> El Martes, 6 de Mayo de 2008, Martijn van Oosterhout escribió:
> > Given a set of closed rings that don't cross you can unambiguously
>  > draw a polygon with it.
>  False. Counter-example: coastline.
>  Given a complete set of coastline polygons (e.g. VMAP0), and somehow removing
>  the clockwiseness of them, please have your computer tell me if Australia is
>  either an island or a lake.

Actually, given VMAP0 polygon's don't wrap at 180 degrees, it really
isn't that hard. That's why we use VMAP0 without difficulty for
lowzoom levels. Pick a point in Australia, determine how many polygons
it is in. Odd=land, even=sea.

If you wanted to be smart you need one reference point, say (0,0)=sea
and work it out from there using a line crossing algorithm. I actually
wrote code like that but coding the coastline checker was far more
interesting and challanging (delete 1% of segments randomly, now
decide what is land/sea!).

Yes, I suppose it's a nice coincidence that our projection makes it
impossible to draw a polygon and accedently say everything except this
is foo, but I don't have a problem with taking advantage of that.

Have a nice day,
Martijn van Oosterhout <kleptog at gmail.com> http://svana.org/kleptog/

More information about the dev mailing list