Transparency of Image overlay on Google Earth (kmz file)

조회 수: 23 (최근 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 CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by