When I'm creating thematic maps with KML, I often end up with a series of files; legend images, icon images, 3D Collada objects and the KML file itself. The KML file is often large because of complex geometries repeated for several time steps. Fortunately, KML files and linked images and 3D objects can be zipped into one KMZ archive, which make file transfer easier and more efficient.
I'm using the PHP ZIP extension to create KMZ files on-the-fly. Basically, a KMZ file has the same properties as a ZIP file. With the PHP extension you can open a new KMZ archive and add your KML code (named "doc.kml") and images/3D objects that are linked with the href element.
For my last blog post, I created a KMZ archive (download) containing one KML file, one folder and three images. The original files are 1,418 kB in total while the KMZ file is only 153 kB - a lot of bandwidth saved!
Links
Sunday, 1 June 2008
Subscribe to:
Post Comments (Atom)




3 comments:
Nice idea
Is it possible to have the php source? I can't manage to do like you..
Hi,
The PHP source code is available here.
Bjørn
Thanks !
(same anonymous ;) )
Post a Comment