Plot 3d points in a map
63 views (last 30 days)
Show older comments
Hi,
I have geographical measurements from an aircraft with latitude, longitude and height coordinates. How can I display the measurements on a map as points three dimensionall where the color of the points change according to the measured value, e.g. temperature?
I have tried using geoplot3 which nicely displays the track of the aircraft. However, this function doesn't seem to allow for point plotting and changing the color according to the measured value. Geoscatter looks like an option but this only seems to work for 2D.
Any help is appreciated.
0 Comments
Answers (1)
Mathieu NOE
on 8 Feb 2024
hello
not an user an neither an expert of geoplot and alike , but maybe this helps
x = [47 50 55 61]; % lat
y = [-122 -132 -140 -149]; % lon
z = [0 170 200 50]; % altitude
h = geoplot(x,y,'-*k');
h.ZData = z; % so now altitude also appears when you click on the point
% modify color of line (edge) according to altitude
N = 256; % color levels
caxis([0 N]);
cd = colormap(parula(N+1));
tmp = linspace(min(z),max(z),N+1); % interp z altitude
cd = interp1(tmp,cd,z); % map color to z values
cd = uint8(cd'*255); % need a 4xN uint8 array
cd(4,:) = 255; % last column is transparency
cbv=colorbar('v');
ind = (0:32:N);
set(cbv,'YTick',ind,'TickLabels',cellstr(num2str(tmp(ind+1)')))
drawnow
set(h.Edge,'ColorBinding','interpolated','ColorData',cd)
2 Comments
Mathieu NOE
on 8 Feb 2024
I don't have the Map Tbx, so I wont be able to try my idea on geoplot3, but you can probably do it on your side
See Also
Categories
Find more on Geographic Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
