displaying elevation profile using geoshow problem

9 次查看(过去 30 天)
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

回答(1 个)

VINAYAK LUHA
VINAYAK LUHA 2023-10-6
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