Mapshow shape files of different coordinates (distance and degrees decimals) using mapping tools in Matlab on each other

2 views (last 30 days)
Hi ,
So I have these two shape files and wanted to plot both together using matlab mapping toolbox functions but the units of the coordinates are different so they are not plotting on each other. I tried some other functions but nothing is working.
Here are my simplest trial:
M0 = shaperead('M0PolygonLayer.shp');
land = shaperead('Canada Background.shp');
figure
hold on
mapshow(land,'FaceColor', [0.9 0.9 0.9]);
mapshow(M0,'FaceColor', [0.9 0.9 0.9], 'Linewidth',2);
%figure on left
plotting both sepeartely,
subplot(2,4,[1,1.8])
mapshow(land,'FaceColor', [0.9 0.9 0.9])
grid on;box on
subplot(2,4,[3.5,7,8])
mapshow(M0,'FaceColor', [0.9 0.9 0.9], 'Linewidth',2);
I tried deg = km2deg(km) to convert MO X and Y to deg but that did not work.
please help me.
Thank you.
KB

Answers (1)

Walter Roberson
Walter Roberson on 11 Apr 2022
You should be passing referencing information to mapshow()
  6 Comments
B
B on 22 Apr 2022
Hi Walter, Thanks for the concern. I am happy to inform you that I have been able to resolve the problem using projcrs,projin, projfwd and geoplot functions. I really appreciate your response.
KB

Sign in to comment.

Categories

Find more on Oceanography and Hydrology in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!