[Tilesathome] Transparent maplint

Robert (Jamie) Munro rjmunro at arjam.net
Mon May 21 12:49:13 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've included a patch below to make maplint tiles have transparent
backgrounds. The idea being that someone who knows xslt remove all the
roads etc. from them, and leave just the errors, and the maplint layer
becomes an overlay instead of a whole layer to itself.

This would mean it could be layed over T at H, mapnik or any other
renderer, and it would also save a lot of space because many (and
eventually all as the data improves) maplint tiles would just be blank
transparent, which could be the 404 default. Even the ones that aren't
blank will probably get smaller because there will be less data on them.

Obviously we could use this to render POI layers by making simple XSL
styles that just show those POIs. It also struck me that cycle at home etc.
could be implimented similarly if we use GD to compare the tile to the
tile below it, and only record the pixels that are different.

What do people think? Does anyone want to volunteer to remove all
non-errors from maplint?

Robert (Jamie) Munro

Index: tilesAtHome/tilesGen.pl
===================================================================
- --- tilesAtHome/tilesGen.pl     (revision 2974)
+++ tilesAtHome/tilesGen.pl     (working copy)
@@ -1062,6 +1062,10 @@
       # If at least one tile is not empty set $allempty false:
       $allempty = 0;

+      if ($layer=="maplint") {
+        $SubImage->transparent($SubImage->colorAllocate(248,248,248));
+      }
+
       # convert Tile to paletted file This *will* break stuff if
different libGD versions are used
       # $SubImage->trueColorToPalette($dither,$numcolors);
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUYc2z+aYVHdncI0RAoNKAKDHmHqCsBBz5mzgl7XPNJNKi0SKkwCeJFwr
4PO/MPWZfZ8UND9GuC4Ul8s=
=SasB
-----END PGP SIGNATURE-----




More information about the Tilesathome mailing list