Be the first to rate this file! 39 downloads (last 30 days) File Size: 5.18 KB File ID: #25104

KML-Matlab-Shapefile conversion

by Michael Toomey

 

21 Aug 2009

Code covered by the BSD License  

Matlab script to import KML files into Matlab as well as conversion to Shapefile.

Download Now | Watch this File

File Information
Description

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.

Required Products Mapping Toolbox
MATLAB release MATLAB 7.6 (R2008a)
Zip File Content  
Other Files kml_shapefile.m,
license.txt,
myKML.kml
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data import Michael Toomey 24 Aug 2009 13:09:15
data export Michael Toomey 24 Aug 2009 13:09:15
earth science Michael Toomey 24 Aug 2009 13:09:15
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com