Transparency of Image overlay on Google Earth (kmz file)

10 次查看(过去 30 天)
Hello,
My purpose is to obtain a contour map using basic Latitude, Longitude, Height/depth data of a location and overlay the image on Google earth using kml toolbox. I was looking for something simlper and this is what I have so far. (Apologies for any mistakes in code, I'm not very comfortable with MATLAB yet)
% reading the bathy data
data = xlsread('./BathymetryData.xlsx');
lon = data(:,1);
lat = data(:,2);
alt = data(:,3);
[xq,yq] = meshgrid(min(lon):.001:max(lon), min(lat):.001:max(lat));
[x,y,z] = griddata(lon,lat,alt,xq,yq, 'cubic');
contour(z,'showtext', 'on','color','b');
saveas(gcf, 'contour.png');
F = getframe(gca);
imwrite(F.cdata, 'contour.png');
% Save it as KMZ.
k = kml('image.kml');
k.overlay(a, b, c, d, 'file','contour.png');
% a, b, c, d being the minimum and maximum Longitude and Latitude values.
k.run;
I'm getting the result I want but I want the overlaying image to be transparent. If it is possible to ONLY show the lines, it would be ideal. How can I approach this?
(I'm using MATLAB R2019b)
Thanks in advance!

回答(1 个)

Mehmed Saad
Mehmed Saad 2020-5-8
Use export_fig to save transparent png

类别

Help CenterFile Exchange 中查找有关 Google Earth 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by