KML-Matlab-Shapefile conversion
Matlab script to read KML files into a mapstruct structure array and offers the option of writing to a Shapefile. KML files must be of a uniform type: Point, LineString, LinearRing or
Polygon. The output contains 5-6 fields, 'Geometry', 'X', 'Y', 'altitude', 'Id' and 'name'. The final field is created and populated only if there is exactly one <name> tag for each feature - these are the names that are used in Google Earth for labeling. This mapstruct array can be easily displayed in Matlab using the 'mapshow' or 'geoshow' command. This output format allows exporting to a Shapefile using the Matlab command, 'shapewrite', which is initiated by entering an output filename into the function. This conversion requires Matlab version 2008a or a more recent version.
Cite As
Michael Toomey (2024). KML-Matlab-Shapefile conversion (https://www.mathworks.com/matlabcentral/fileexchange/25104-kml-matlab-shapefile-conversion), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Mathematics and Optimization > Mapping Toolbox > Data Import and Export >
- Radar > Mapping Toolbox > Data Import and Export >
- MATLAB > External Language Interfaces > Other languages > Google > Google Earth >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.