File Exchange

image thumbnail


version 1.3 (4.19 KB) by

Converts .kml file types into self-contained .kmz filetypes.



View License

kml2kmz copies all the support documents used by the kml into a single 'files' folder, and updates the file path in the kml to the new relative path accordingly. The kml is also copied, then zipped up with the new copies of supporting files. The zip file is then renamed with a .kmz extension, and put in the same folder as the original kml. The new copies of supporting documents are then deleted by default. Supporting documents referenced by KML attributes are not yet supported.

Comments and Ratings (2)

Ryan Bell

Thanks! Don't mind at all, please include.

Rafael Oliveira

Rafael Oliveira (view profile)

Hi, really nice code, would you mind if I include your code into the my kml toolbox? (FE:




v2.1 - added conditional check for existing, but empty, elements


Added online file download, improved error detection, and does not copy identical files more than once.

MATLAB Release
MATLAB 8.0 (R2012b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video