Skip to content

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;


Published inWeb Development

One Comment

  1. Faiq Faiq

    Thank you, easy and unbelievable
    cheers from Afghansitan

Leave a Reply

Your email address will not be published. Required fields are marked *