Plotting google earth polygon data in a longitude latitude grid

1 次查看(过去 30 天)
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!

回答(2 个)

JMvanwessem
JMvanwessem 2012-2-13
Well, no replies..But I got a bit further....So new question:
I have a gridded latitude longitude DEM, on this DEM I want to add the polygons I by now have substracted from the google earth kml file. But obviously the polygon does not match the coordinates of the grid. What would you people advise to do in order to add the polygon data (make the places at where there is a polygon (in which the DEM falls within the polygons) a NaN)? Interpolating every polygon line point on the grid is too numerically expensive I presume, in my case.

Athmajan Vivekananthan
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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by