Plotting google earth polygon data in a longitude latitude grid
Show older comments
I am stuck with the following:
I have a data set with google earth polygons (in a .kml) file and want to process this in matlab. The data set consists of polygons at many different positions(latitude longitude). I want to use this as a mask on an exisiting gridded latitude longitude DEM, so want to set values of the DEM inside the Polygons to zero (or NaN).
The problem is I have no idea how the original google earth file is formatted and using the Google Earth toolbox I cannot figure it out. Could somebody give me a hint how to process google earth data in matlab in general (i can't really get it to work, I only manage to output existing gridded data into .kml/.kmz files but not the other way around).
Right now I am trying to interpolate the polygon data on the original grid, but as said, the problem is how the .kml is structured...When I input the .kml data with kmlread I get 3 vectors: a latitude, longitude and a z vector only consisting of zeros (and this is a 40000x1 vector, consisting of many small polygons (I presume)).
Thanks in advance!
Answers (2)
JMvanwessem
on 13 Feb 2012
1 vote
Athmajan Vivekananthan
on 31 Jul 2018
0 votes
I encountered a similar problem but what I wanted was coordinates of the points of the google earth KML polygon. What I did was I opened KML file in notepad and read the text file in Matlab to manipulate the coordinate values
Categories
Find more on Standard File Formats in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!