PHP: Converting a KML into a KMZ

微笑、不失礼 提交于 2019-12-11 10:30:08

问题


I've got a custom php script that creates a KML file. Now how do I convert it into KMZ?

Should I just run gzcompress() on it?

Or should I create a ZipArchive?


回答1:


Creating a ZipArchive worked. I add the already created kml file to it.

  $zip = new ZipArchive();
  $zip_name = "c:\\kml\\".$sFilename.".kmz";
  $filename = "c:\\kml\\".$sFilename.".kml";
  $zip->open($zip_name, ZIPARCHIVE::CREATE);
  $zip->addFile($filename);
  $zip->close();


来源:https://stackoverflow.com/questions/21149383/php-converting-a-kml-into-a-kmz

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!