Friday 31 August 2007

ImagePyramid Tiles from GMapImageCutter

For those without access to Photoshop, jpeg tiles for KML PhotoOverlays can be generated using the Google Maps Image Image Cutter by the UCL Centre for Advanced Spatial Analysis (CASA).

Pad your source image out so that it occupies the bottom left of a square image with a side length in pixels of a power of 2 (maximum size 8192x8192 pixels). Load it into Google Maps Image Cutter and set the 'Max Zoom Level' according to the image size as follows:

Size [px]Max Zoom Level
8192 x 81926
4096 x 40965
2048 x 20484
1024 x 10243

Create your tiles, which will be placed in a new folder.

All that is left to do is to run makepyr.bat from the same folder. It will create copies of the Image Cutter tiles, with names that are compatible with the KML2.2 ImagePyramid element. Ignore any file not found error messages.

One drawback with this approach is that it is likely to generate some unnecessary tiles at higher zoom levels from the image padding areas. These are pretty easy to spot (e.g. they are identical, uniform in colour and probably the smallest file size) and manually delete.

No comments: