displaying elevation profile using geoshow problem

11 Ansichten (letzte 30 Tage)
JJ
JJ am 23 Mär. 2022
Beantwortet: VINAYAK LUHA am 6 Okt. 2023
lat = [-20 -16] ;
lon = [174 180] ;
worldmap(latlim,lonlim);
load coastlines
geoshow(coastlat,coastlon,'DisplayType','texturemap')
hi, im trying to display elevation profile of lat,lon coordinates above using geoshow, however there is error in code im unsure how to properly use goeshow. Any help would be greatly appreciated

Antworten (1)

VINAYAK LUHA
VINAYAK LUHA am 6 Okt. 2023
Hi JJ,
I understand that you want to display the elevation profile of a geographical region defined by latitude and longitude ranges using the “geoshow” function.
Follow the below pointers to display the elevation profile using “geoshow” function-
  1. Use the “topo” Digital Elevation Model (DEM) provided by the “MATLAB Mapping Toolbox” to obtain a gridded elevation dataset.
  2. Obtain the “latitude” and “longitude” values using the “meshgrat” function.
  3. Create an axesm-based map for world region using “worldmap” function.
  4. Display map latitude and longitude data on the created axis using “geoshow” function.
Refer to the following code snippet to display the elevation profile using “geoshow” function:
load topo
load coastlines
colormap parula
[lat,lon] = meshgrat(topo,topolegend);
Warning: MESHGRAT will be removed in a future release. Use geographicGrid or NDGRID instead.
latlim = [-20 -16] ;
lonlim = [174 180] ;
imagesc(flip(topo))
worldmap(latlim,lonlim);
geoshow(lat,lon,topo,'DisplayType','texturemap')
hold on
geoshow(coastlat,coastlon,'DisplayType','polygon')
colorbar
Refer to the following documentations for more details on the functions used in the code snippet:
Hope this helps in visualizing the elevation in a geographical region defined by a range of latitudes and longitudes.
Regards,
Vinayak Luha

Community Treasure Hunt

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

Start Hunting!

Translated by