How to convert KMZ to KML

A KMZ file is just a zipped KML file.

Rename the KMZ file with a .zip extension, then open it in your favorite ZIP program.

Here’s a bit of PHP to convert a KMZ file to KML:

$data = file_get_contents(""); // url of the KMZ file
passthru('unzip -p /tmp/kmz_temp');
$xml_data = ob_get_clean();
header("Content-type: text/xml");
echo $xml_data;


1 thought on “How to convert KMZ to KML

Leave a Reply

Your email address will not be published.