필터 지우기
필터 지우기

Question regarding plotting a map consisting of different layers

조회 수: 5 (최근 30일)
Dipto
Dipto 2023년 5월 30일
답변: Debadipto 2023년 6월 8일
Hello,
Using Matlab Mapping Toolbox, I want to plot a map (Baltic Sea Region, to be specific) which has three different layers in shapefile format, i.e. coastline, bathymetry, and land. However it doesn't work so far.
Here is the code:
% Load shapefile data
balticSea.coast = shaperead('ne_10m_coastline.shp');
balticSea.land = shaperead('ne_10m_land.shp');
balticSea.bathym = shaperead('ne_10m_bathymetry.shp')
% Create a figure
figure
mapshow(balticSea.coast)
mapshow(balticSea.land)
mapshow(balticSea.bathym)
Is there any ways to solve this?
Thank you.

답변 (1개)

Debadipto
Debadipto 2023년 6월 8일
Hi Dipto,
Based on my understanding, you want to plot the three shapefiles on top of each other in a single map. You can utilise the ‘hold on’ syntax to get the desired output. Here is the updated code:
% Load shapefile data
balticSea.coast = shaperead('ne_10m_coastline.shp');
balticSea.land = shaperead('ne_10m_land.shp');
balticSea.bathym = shaperead('ne_10m_bathymetry.shp')
% Create a figure
figure
mapshow(balticSea.coast)
hold on
mapshow(balticSea.land)
mapshow(balticSea.bathym)
Regards,
Debadipto Biswas

카테고리

Help CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by