Azzera filtri
Azzera filtri

Slice command for terrain

1 visualizzazione (ultimi 30 giorni)
burak ergocmen
burak ergocmen il 19 Feb 2024
Commentato: burak ergocmen il 22 Feb 2024
Hi,
After dowloading topo data (.tif) from opentopography.org. I use "Imread". For plotting the data
A=imread('appRasterNEDAPIService1708354512850-756880040.tif');
surf(A):
It plots the 3D terrain data.
The size of the A is 194x424. It contains elevation data. I want to use slice command but in slice command there are x,y,z, and v.
After meshgrid the dimesion of the x becomes 3D and the same for y and z for 'slice' command. v is the function.
But as I stated my terrain data can not be converted for slice command. Is there anything that helps me?
Thank you

Risposta accettata

Walter Roberson
Walter Roberson il 19 Feb 2024
No. Your data cannot be sliced.
Perhaps you might want to contour() the data, and get back the contour matrix, and use something like https://www.mathworks.com/matlabcentral/fileexchange/38863-extract-contour-data-from-contour-matrix-c to extract data from the contour matrix.
  4 Commenti
burak ergocmen
burak ergocmen il 21 Feb 2024
Thank you again
'improfile' can be good start for me but I need 2D plane. With 'improfile', only the line is taken into account. I want to give more information for my problem:
A=imread('appRasterNEDAPIService1708354512850-756880040.tif');
X=1:324;
Y=1:194;
[X,Y]=meshgrid(X,Y);
surf(X,Y,A)
hold on
contour3(X,Y,A,"k",'ShowText','on')
x2=[50 200 200 50 50]; %for the plane
y2=[50 50 170 170 50];
z2=[4200 3800 3800 4200 4200];
plot3(x2,y2,z2);
hold on
fill3(x2,y2,z2,'r')
textscatter3(50,50,4200,"aircraft",'ColorData',[0.5 0.6 0.7]);
textscatter3(200, 170, 3800,"runway", 'ColorData',[0.5 0.6 0.7]);
I draw a 2D plane (red). The aircraft and the runway positions are given. I it possible to create a new map from the intersection of the red plane and the terrain?? Finally I try to create a 2D map. The terrain data in this map is given as for terrain =1 and freeterrain=0. It becomes A= [0 0 0 0 0 0 0 0 ......; 0 0 0 0 0 1 1 1 0 0 0...]]. Maybe it is like that:
Thank you,
burak ergocmen
burak ergocmen il 22 Feb 2024
I use this code to plot the intersection.
I appreciate your suggestion. Thank you

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by