File Exchange

image thumbnail

read_kml

version 2.0 (5.98 KB) by

Reads a Google Earth .kml file into Matlab

3.66667
3 Ratings

60 Downloads

Updated

View License

Opens a Google Earth kml file and reads the coordinates (x,y,z) into Matlab.

Comments and Ratings (5)

Kyle Spencer

Would this still work if you converted your google earth pro in to UTM coordinates?

Joao

Joao (view profile)

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

Evan Artis

Testing it out.

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.

Updates

2.0

update lisence

2.0

Now reads multiple sets of coordinates. (x,y) can be in any coordinate system.

MATLAB Release
MATLAB 7.3 (R2006b)

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

» Watch video