Technical Guideline Series
Prepared by Joy Kumagai - Technical Support Unit (TSU) of Knowledge and Data Reviewed by Aidin Niamir - Head of the Technical Support Unit of Knowledge and Data For any inquires please contact aidin.niamir@senckenberg.de
Version: 2.1 Last Updated: 15 July 2022
The guide will show how to convert raster and vector data from a projection to the Robinson projection using R and is intended for IPBES experts creating maps. IPBES has adopted the Robinson projection for visualizing global scale maps as it balances distortions in area, direction, distance, and distortions near the poles. Please note that the projection used for analysis and whether one would like to display a Pacific centered or Greenwich centered map depends on the application. For example, If calculating area, an equal-area projection is needed.
Begin by loading the following packages.
Next, we define the Robinson projection using PROJ.4 notation. This information can be found at the this link.
To produce a Greenwich centered map in the Robinson projection with raster data, we will load precipitation data from world clim and plot the result, but please load and use the raster data that you will be working with. The crs() function will output the projection that your data is in.
Next, we will create a mask, and then project the data with this mask so repeated areas of the world map are removed.
Now we can plot our results to ensure it is correct.
The next step is to create graitcules and labels to add to all of the next plots.
The warnings of discarding the datum can be safely ignored in this case*.
Finally, we will plot the raster with the graticules we just created.
In this section, we will produce a world map of countries with vector data (points, lines, polygons). First, we will load, check the projection, and plot a world map of countries.
Now, we project the vector data into the Robinson projection and plot the map with graticules.
If there are polygons that cross the date line, it is possible that some erroneous polygons may appear. If this occurs, the solution is to run the function st_wrap_dateline() before projecting.
Finally, we will visualize both the raster and vector data together in one map.
Your feedback on this content is welcome. Let us know what other useful material would you like to see here by emailing aidin.niamir@senckenberg.de.
*The warnings of discarding the datum but preserving the +towgs1984 = values
stem from an update from PROJ4 to PRROJ6 but is not worriesome in this case. The +datum=
part is depreciated from GDAL >3 and sf, rgdal, and raster packages use GDAL to read files. There is a stackoverflow thread with more information here