This function provides suggestions for map projections depending on the extent of the map. For SDMs, an equal area projection is generally favoured, but it is also possible to get suggestions for conformal, equidistant or compromise projections. The algorithm is a reimplementation in R of Projection Wizard (Bojan et al., 2016), version 2.1. (https://projectionwizard.org/)

suggest_crs(
  x,
  distortion = c("equal_area", "conformal", "equidistant", "compromise"),
  round_cm = FALSE,
  return_best = TRUE,
  datum = c("WGS84", "ETRS89", "NAD83"),
  unit = c("m", "ft"),
  lat_check = TRUE,
  world_equidist = NULL,
  quiet = FALSE
)

Arguments

x

A vector of four numeric values representing the extent of the map (xmin, xmax, ymin, ymax), or a SpatExtent object, or a SpatRaster object.

distortion

The type of distortion to be minimized. Options are "equal_area", "conformal", "equidistant" and "compromise". Default is "equal_area".

round_cm

Logical. If TRUE, the central meridian is rounded to the nearest degree. Default is FALSE.

return_best

Logical. If TRUE, only the best projection is returned, otherwise, if there are multiple options, a list will be returned

datum

The datum to use. Options are "WGS84", "ETRS89" and "NAD83". Default is "WGS84".

unit

The unit to use. Options are "m" and "ft". Default is "m".

lat_check

Logical. If TRUE, the function will check if lat values are within range (-90,90). Default is TRUE.

world_equidist

if distortion="equidistant" for a whole world projection, then this parameter should be a list with one of the following sets of elements:

  • "Polar azimuthal equidistant": prj = "polar", pole, lng_central``, where poleis either -90 or 90 for the South and North Pole, respectively, from or through which distances are correct, andlng_centralis the central meridian. E.g.list(prj = "polar", pole = 90, lng_central = -180)`

  • "Oblique azimuthal equidistant": prj = "oblique", lat_centre, lng_centre, where lat_centre and lng_centre are the latitude and longitude of the centre from or through which distances are correct. E.g. list(prj = "oblique", lat_centre = 39, lng_centre = 145)

  • "Two-point azimuthal": prj = "two_points", lat1, lng1, lat2, lng2, where lat1, lng1, lat2, lng2 are the latitude and longitude of two points on the map from which distances are correct. E.g. list(prj = "two_points", lat1 = 34, lng1 = -117, lat2 = 46, lng2 = 16)

quiet

Logical. If TRUE, suppresses messages. Default is FALSE.

Value

Either a list of two strings (proj4 and WKT) for a single projection (if either only one projection is available or return_best is TRUE), or a list of lists, each containing two strings (proj4 and WKT) for a single projection (if multiple projections are available and return_best is FALSE).

References

Bojan, S, Bernhard, J, & Helen, J (2016) Projection Wizard - An Online Map Projection Selection Tool. The Cartographic Journal 53(2):177-185 DOI: 10.1080/00087041.2015.1131938

Examples

# Whole map
suggest_crs(c(-180, 180, -90, 90))
#> $proj4
#> [1] "+proj=eqearth +lon_0=0 +datum=WGS84 +units=m +no_defs"
#> 
#> $wkt
#> [1] "PROJCS[\"ProjWiz_Custom_Equal_Earth\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Equal_Earth\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0],UNIT[\"Meter\",1.0]]"
#> 
#> $description
#> [1] "Equal Earth"
#> 
#> $notes
#> [1] "Equal-area world map projection with poles represented as lines"
#> 
# Northen Hemisphere
suggest_crs(c(-180, 180, 21, 70))
#> $proj4
#> [1] "+proj=laea +lon_0=0 +lat_0=45.5 +datum=WGS84 +units=m +no_defs"
#> 
#> $wkt
#> [1] "PROJCS[\"ProjWiz_Custom_Lambert_Azimuthal\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0],PARAMETER[\"Latitude_Of_Origin\",45.5],UNIT[\"Meter\",1.0]]"
#> 
#> $description
#> [1] "Lambert azimuthal equal-area"
#> 
#> $notes
#> [1] "Equal-area projection for maps showing a hemisphere"
#> 
# Hemisphere showing the tropics
suggest_crs(c(-180, 180, -7, 21))
#> $proj4
#> [1] "+proj=cea +lon_0=0 +lat_ts=0 +datum=WGS84 +units=m +no_defs"
#> 
#> $wkt
#> [1] "PROJCS[\"ProjWiz_Custom_Cylindrical_Equal_Area\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Cylindrical_Equal_Area\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0],PARAMETER[\"Standard_Parallel_1\",0],UNIT[\"Meter\",1.0]]"
#> 
#> $description
#> [1] "Cylindrical equal-area"
#> 
#> $notes
#> [1] "Equal-area projection for maps showing the tropics"
#> 
# Regional map for EW extent
suggest_crs(c(-60, 20, 40, 70))
#> $proj4
#> [1] "+proj=aea +lon_0=-20 +lat_1=45 +lat_2=65 +lat_0=55 +datum=WGS84 +units=m +no_defs"
#> 
#> $wkt
#> [1] "PROJCS[\"ProjWiz_Custom_Albers\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-20],PARAMETER[\"Standard_Parallel_1\",45],PARAMETER[\"Standard_Parallel_2\",65],PARAMETER[\"Latitude_Of_Origin\",55],UNIT[\"Meter\",1.0]]"
#> 
#> $description
#> [1] "Albers equal-area conic"
#> 
#> $notes
#> [1] "Equal-area projection for regional maps with an east-west extent"
#>