Transparency of Image overlay on Google Earth (kmz file)

20 ビュー (過去 30 日間)
Jake
Jake 2020 年 5 月 8 日
回答済み: Mehmed Saad 2020 年 5 月 8 日
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 Center および File ExchangeMap Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by