How to shift a map, so that the Pacific Ocean will be in the center?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Leon
el 26 de Abr. de 2015
Comentada: Leon
el 29 de Abr. de 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 comentarios
Respuesta aceptada
Philip Caplan
el 27 de Abr. de 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.
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!