How to shift a map, so that the Pacific Ocean will be in the center?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Leon
am 26 Apr. 2015
Kommentiert: Leon
am 29 Apr. 2015
I'm using the below commands to plot a global map.
S1 = shaperead('map/ne_110m_land.shp');
mapshow(S1);
How do I shift the map slightly, so that the Pacific Ocean will be displayed in one piece? When I used plot(x,y, 'k.') to do the plot, I can simply use x(x<20)=x(x<20)+360 to deal with it. How should I do it in mapshow?
Thank you.
0 Kommentare
Akzeptierte Antwort
Philip Caplan
am 27 Apr. 2015
Here is an example of how to shift the x-coordinates of all the geometries stored in the 'concord_roads.shp':
S1 = shaperead('concord_roads.shp');
S2 = S1;
for i=1:length(S2)
S2(i).X = S2(i).X +1e5; % replace appropriate shift here
end
figure(1); mapshow(S1);
figure(2); mapshow(S2);
You will notice that the x-coordinates in Figure 2 are all shifted by 1e5.
You may not need to apply this shift to all the geometries stored in the structure returned by shaperead so you may only need to apply this shift to a certain subset of the geometries describing the Pacific Ocean.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Map Display finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!