Aus Geoinformation HSR
Wechseln zu: Navigation, Suche

Keyhole Markup Language (KML) gzipped.

KMZ ist mehr als gzipping: "You actually have to generate a ZIP format catalog which containts a KML document. Just use your favourite tool to add your KML document to a ZIP file, then rename the ZIP file to KMZ. Google Earth client appears to store the internal KML document as doc.kml, but seems to happily read the first KML document it finds in the KMZ file, regardless of name."

Damit können auch statische Bilder einmal mitgeschickt werden ohne sie ständig neu laden zu müssen. "The problem comes when you want to reduce bandwidth by sending KMZ documents from a script in response to a NetworkLink."

In PHP, nehme man das PEAR module (writing to ZIP files) oder man suche Google ( nach "zip.lib.php", um folgendes programmieren zu können:

// Instantiate the zipfile
$myZip = new zipfile;
// Add your carefully crafted KML data to the zipfile (in memory)
// Send the appropriate content type for KMZ
header('Content-Type: application/');
// Output the zip file, which includes the KML document
print ($myZip->file);