This function will convert kml and kmz files to a matlab structure. If converting a kmz file it will extract it to a directory called '.kml2struct' in your home directory. This directory will be deleted when the function exits.
The output of this function should be similar to 'shaperead' except that it will add another field, "Folder", for the kml folder where the shape was file.
This function will only handle kml/kmz files with Point, LineString, and Polygon geometries. If you try to run this on a kml/kmz with different elements those elements will be omitted from the result
Nathan Ellingson (2021). kmz2struct (https://github.com/ellingsonj/kmz2struct), GitHub. Retrieved .
Worked well. It would be great if it could also support Track type <gx:Track>, result from GPX file import to Google Earth.
This works well, but requires poly2cww.m from the Mapping toolbox. If you don't have the Mapping Toolbox, it works fine if you remove this and substitute the following for line 130
Just remember to be careful with the result as it may not be in counter clockwise order.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!