[OSM-dev] Blue sea for tiles at home
Robert (Jamie) Munro
rjmunro at arjam.net
Tue Apr 24 18:51:19 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Frederik Ramm wrote:
> I have just committed a t at h extension (new version name "Glencoe")
> that creates blue sea tiles.
> The algorithm is a bit complex (over 700 lines of Perl code), and if
> anyone finds a simpler way to do it, please step forward and submit
> patches or redo it.
> It works like this:
> * If the tile being rendered has no "natural=coastline" ways, then
> look up the tile coordinates in a table (which is supplied as a
> 4 MB binary file covering every single level-12 tile in the world,
> thanks to Martijn for providing it!).
Surely as there is less land than water in the world, it would be better
to mark only what is land in the index. Also, a lot of places we know to
be land because they have roads on them, so all the index needs to
contain is empty land tiles. In fact, we could just put nodes in each
empty tile saying with a key "land=1", then tiles at home will fetch those
nodes as normal, so there is no need for this index at all.
I the next step is that tiles at home uploads blank land tiles, but not
blank sea tiles. Then the default colour for a not found tile can be
blue, and can cover 2/3rds of the earth.
> * If the tile being rendered has any coastline segments at all, then
> throw away the coastline ways, and re-arrange all the segments into
> one big way, connecting the loose ends coming into the visible area
> from the outside or leaving the visible area, so that closed ways
> are formed.
> o This method requires us to know which side of a segment the water
> is on. We assume it is always on the right.
So coastlines go anticlockwise? Which makes the land a hole in the sea,
rather than the sea a hole in the land. This is a good thing IMHO. This
does mean that for huge lakes, we can just give them clockwise coastline
ways, and everything will work perfectly.
Robert (Jamie) Munro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the dev