Question regarding plotting a map consisting of different layers
5 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Map Display 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!