Plot 3d points in a map

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.

Answers (1)

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

Martin
Martin on 8 Feb 2024
Edited: Martin on 8 Feb 2024
Thank you, however I am aiming at the 3D view. With geoplot3 I plotted the track in this way:
I wonder if there is a way to replace the line of the track with points that change color according to the measured value?
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

Sign in to comment.

Categories

Products

Release

R2022a

Asked:

on 8 Feb 2024

Commented:

on 8 Feb 2024

Community Treasure Hunt

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

Start Hunting!