Robinson map projection?

11 ビュー (過去 30 日間)
Ali Almakhmari
Ali Almakhmari 2022 年 8 月 3 日
回答済み: Omega 2023 年 9 月 7 日
I have a map of Earth in the cylindrical projection that has all the planet's data (longitude: -180 to 180 degrees, latitude: -90 degrees to 90 degrees), similar to the one attached. Is there a way in MATLAB to change the projection of this map into the Robinson projection? Any advice is appreciated

採用された回答

Omega
Omega 2023 年 9 月 7 日
Hello Ali,
Ensure that you have the “Mapping Toolbox” installed in MATLAB. It provides built-in support for various map projections, including the Robinson projection. You can check whether you have the Mapping Toolbox installed or not using the “ver mapping_toolbox” command.
You can achieve the desired Robinson Projection using a MATLAB script. In the script, you can create a new figure with a Robinson projection using the “axesm” function and specify the latitude and longitude limits. Then, create a geospatial reference object to associate the map image with the Robinson projection. Finally, use “geoshow” to display the georeferenced image in the Robinson projection.
Feel free to refer to the provided code below as an example:
% Load and display the map image (assuming it's in equirectangular projection)
mapImage = imread('600px-Cylindrical_equal-area_projection_SW.jpg');
% Display Original Image
imshow(mapImage);
title('Equirectangular Projection');
% Create a new figure with a Robinson projection
figure;
ax = axesm('robinson', 'FFaceColor', 'none', 'FEdgeColor', 'k');
% Define the latitude and longitude limits for the Robinson projection
latlim = [-90 90];
lonlim = [-180 180];
% Rotate the image by 180 degrees
mapImage = fliplr(rot90(mapImage, 2));
% Create a geospatial reference object for the Robinson projection
georef = georefcells(latlim, lonlim, size(mapImage));
% Display the georeferenced image in the Robinson projection
geoshow(ax, mapImage, georef);
title('Robinson Projection');
Output Image:
To know more you can refer to the following documentation links:

その他の回答 (0 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by