No BSD License  

3.66667

3.7 | 3 ratings Rate this file 81 Downloads (last 30 days) File Size: 4.98 KB File ID: #13026

read_kml

by

 

16 Nov 2006 (Updated )

Reads a Google Earth .kml file into Matlab

| Watch this File

File Information
Description

Reads in a simple Google Earth kml into Matlab. If you have bought Google Earth Plus, you can digitize 'paths' (lines). This funcion allows you to load one of these saved paths into Matlab. This code extracts lat,lon and z from a kml file.

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
25 Sep 2012 Joao

Great, but kml document breaks coordinates if there are more than 1000 points.
So in this function you just pick the first 1000 points.
Maybe with another if, you can check if there are a second block of coordinate.

thanks

02 Oct 2009 Erdal Bizkevelci  
27 Jun 2008 Evan Artis

Testing it out.

23 Nov 2006 Malcolm Wood

Nice function. I think you could make it much more robust to mis-placed spaces by using "xmlread" and then the W3C XML-handling classes, e.g.:
>> doc = xmlread(fileName);
>> c = doc.getElementsByTagName('coordinates').item(0);
>> coord_str = c.getChildNodes().item(0).getData();
etc.

Contact us