I found one post about KMZ files from 2006, but no answer :/.
So here is the question again, if somebody knows how to save/export
kmz files in Matlab to use it in Google Earth?! I compute some
variables like DTM, DTM variances, data point density and would like
to show it on the map. The images I create in Matlab have WGS84
coordinate system.
Would be very grateful for any suggestions, even if you know it is not
"jet" possible to do it in Matlab! Thank you.
Greets,
Maja
Newsgroups: comp.soft-sys.matlab
From: "Cynthia Schuck" <c.sch...@sciencenat.com>
Date: Fri, 15 Sep 2006 10:27:17 -0400
Local: Fri, Sep 15 2006 4:27 pm
Subject: exporting to Google Earth
Dear all,
I wonder if any of you would know about the possibility of exporting
raster images and vector files from Matlab to Google Earth (namely,
generate kmz files that Google Earth can read).
Thank you!
Cynthia
Hello,
First of all, have you already created a .kml file?
Do you have overlays or other images involved?
Guessing yes, have you ever unzipped a kmz file by changing its extention to .zip ?
If you did, you noticed that as you save a kml file as kmz via GoogleEarth, a 'files' folder and a doc.kml file are created in the .kmz zipped file.
From now you'll notice that the paths that you had written in the <href></href> of your groundoverlays, etc. have changed to take the following shape : "files/myImage.jpg" for eg. A quick look at the Files folder will confirm that your images are all stored in the sole 'files' folder.
Thus, if you want to create a kmz file in matlab, you'll have to store the images in a "files" folder and rename myFile.kml as doc.kml. then you'll have to change all image paths so that they fit the "files/myImage.jpg" shape.
Then all you have to do is to zip your 'files' folder and doc.kml altogether.
I haven't done the job so far so check that there are not other modifications made in the kml code as it is saved as a .kmz file through GE...
Laurent
To generate a kmz file from there, i used the folowing code :
zip('myKmz.kmz',{'files' 'doc.kml'});
% This creates a zipped file named 'myKmz.kmz.zip'
a = ['myKmz.kmz' '.zip'];
finalKmz = a(1:length(a)-4); % is a string removing the '.zip' part
movefile(a, finalKmz); % renames my zipped file to 'mykmz.kmz'.
Hope it helps.
Laurent