getCRS: Return a "proj4" string for a datum and projection

View source: R/getCRS.r

getCRSR Documentation

Return a "proj4" string for a datum and projection

Description

This function returns the "proj4" string for a particular datum and possibly projection. It is intended to be easier to use than looking up particular proj4 strings (i.e., on the web).

Usage

getCRS(x, asCRS = FALSE)

Arguments

x

Character. Name of proj4 string to return. Possible values include:

  • albersNA Albers equal-area conic for North America: +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

  • albersEur Albers equal-area conic for Europe: +proj=aea +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs

  • madAlbers Albers equal-area conic for Madagascar: +proj=aea +lat_1=-14 +lat_2=-24 +lat_0=-19 +lon_0=47 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84

  • climateNA ClimateNA dataset: +proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84

  • chelsa CHELSA climate dataset (actually WGS84): or +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84

  • dayMet DayMet dataset: +proj=lcc +lon_0=-100 +lat_0=42.5 +x_0=0 +y_0=0 +a=6378137 +rf=298.257223563 +lat_1=25 +lat_2=60

  • lccCONUS Lambert conformal conic for the contiguous United States: +proj=lcc +lat_1=33 +lat_2=45 +lat_0=39 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

  • lccEp Lambert conformal conic for Europe: +proj=lcc +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs

  • lccNA Lambert conformal conic for North America: +proj=lcc +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

  • lccNAsia Lambert conformal conic for North Asia: +proj=lcc +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

  • lccSA Lambert conformal conic for South America: +proj=lcc +lat_1=-5 +lat_2=-42 +lat_0=-32 +lon_0=-60 +x_0=0 +y_0=0 +ellps=aust_SA +units=m +no_defs

  • lccSAsia Lambert conformal conic for South Asia: +proj=lcc +lat_1=7 +lat_2=-32 +lat_0=-15 +lon_0=125 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

  • laeaN Lambert azimuthal equal area for the North Pole: +proj=laea +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

  • laeaS Lambert azimuthal equal area for the South Pole: +proj=laea +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

  • mollweide Mollweide equal-area for the world: +proj=moll +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs

  • codenad27 NAD27 (unprojected): +proj=longlat +datum=NAD27 +no_defs +ellps=clrk66 +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat

  • nad83 NAD83 (unprojected): +proj=longlat +datum=NAD83 +no_defs +ellps=GRS80

  • nad83harn NAD83 HARN (unprojected): +proj=longlat +ellps=GRS80 +no_defs

  • plateCaree Plate Caree using WGS84: +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_def

  • prism PRISM dataset (actually WGS84): +proj=longlat +ellps=GRS80,0,0,0,0 +no_defs

  • robinson Robinson: +proj=robin +lon_0=0 +x_0=0 +y_0=0

  • wgs72 CRS for WGS72 (unprojected): +proj=longlat +ellps=WGS72 +no_defs

  • wgs84 CRS for WGS84 (unprojected): +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84

  • worldclim WORLDCLIM climate data set (actually WGS84): +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84

  • UTM projections require the datum (e.g., NAD27, NAD83, WGS84, etc.), the hemisphere (north or south) and the zone. The "code" is as: utm<coordinate system><hemisphere><zone>. For example, utmNad83north9 returns the CRS for UTM zone 9 in the northern hemisphere using the NAD83 coordinate reference system. Likewise, utmNad27south6 returns the CRS for UTM zone 6 in the southern hemisphere using the NAD27 coordinate system. So far the following have been implemented:

    • Coordinate Systems: nad27, nad83, wgs84

    • Hemispheres: north

asCRS

Logical. If TRUE then return object is of class CRS. If FALSE (default) then returned object is of class character.

Value

Object of class CRS or character.

See Also

makeCRS

Examples

getCRS('wgs84')
getCRS('prism')
getCRS('mollweide', TRUE)

adamlilith/enmSdm documentation built on Jan. 6, 2023, 11 a.m.