Robinson map projection?

11 views (last 30 days)
Ali Almakhmari
Ali Almakhmari on 3 Aug 2022
Answered: Omega on 7 Sep 2023
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

Accepted Answer

Omega
Omega on 7 Sep 2023
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:

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!