makeCRS: Create a custom "PROJ.4" string for a datum and projection

Description Usage Arguments Details Value See Also Examples

View source: R/makeCRS.r

Description

This function returns a custom "PROJ.4" string for a particular datum and possibly projection. Currently only the Lambert azimuthal equal-area projection and Albers conic equal-area projections are supported.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
makeCRS(
  x,
  long0 = NULL,
  lat0 = NULL,
  long1 = NULL,
  lat1 = NULL,
  long2 = NULL,
  lat2 = NULL,
  dat = "WGS84",
  ell = "WGS84",
  asCRS = FALSE
)

Arguments

x

Character. Name of PROJ.4 string to return. Possible values include:

  • albers CRS for the Albers equal-area projection: +proj=aea +lat_1=lat1 +lat_2=lat2 +lat_0=lat0 +lon_0=long0 +x_0=0 +y_0=0 +ellps=ell +datum=datum +units=m, where ell is the ellipsoid; datum the datum; the pair long0 and lat0 the longitude and latitude of the center point of the projection (in degrees); and lat1 and lat2 the first and second standard parallels. This projection is good for mid-latitudes.

  • lcc CRS for the Lambert conformal conic projection: '+proj=lcc +lat_1=lat1 +lat_2=lat2 +lat_0=lat0 +lon_0=long0 +x_0=0 +y_0=0 +ellps=ell +datum=dat +units=m', where ell is the ellipsoid; the pair long0 and lat0 are the longitude and latitude of the center point of the projection (in degrees); and and lat1 and lat2 are the first and second standard parallels.

  • laea CRS for the Lambert azimuthal equal-area projection: +proj=laea +lat_0=lat0 +lon_0=long0 +x_0=0 +y_0=0 +ellps= +datum=dat +units=m, where ell is the ellipsoid; and the pair long0 and lat0 are the longitude and latitude of the center point of the projection (in degrees). Defaults: ell = 'GRS80'. This projection is good for high latitudes/polar regions.

  • mollweide CRS for the Mollweide equal-area projection: +proj=moll +lon_0=long0 +x_0=0 +y_0=0 +ellps=ell +datum=dat +units=m, where ell is the ellipsoid; and long0 the center meridian of the projection (in degrees). This projection is good for world maps.

  • naturalEarth or ne CRS for the Natural Earth "compromise" projection: +proj=natearth +lon_0=long0 +ellps=ell +datum=dat +units=m, where long0 is the central meridian, ell is the ellipsoid; and long0 the centeral meridian of the projection (in degrees). This projection is good for world maps.

  • oae or aeqd CRS for the oblique azimuthal equidistant projection: '+proj=aeqd +lat_0=lat0 +lon_0=long0 +ellps=ell +datum=dat' where long0 and lat0 are the center point of the projection (in degrees). This projection is good for any region of the world.

  • winkelTriple or wt CRS for the Winkel Triple: '+proj=wintri +lon_0=long0' where long0 is the central meridian of the projection (in degrees). This projection is good for the world.

long0, lat0

Numeric, specify central point or meridian of the projection. Units are degrees. Both or just one may be needed for a given projection.

long1, long2, lat1, lat2

Numeric, specify additional standard parallels or meridians, depending on the projection. These are not needed for all projections.

dat

Character, name of datum. If NULL, then default values are used. Typically, if you specify the datum then the ellipsoid (ell) need not be specified since a particular ellipsoid is used for each datum.

ell

Character, name of ellipse. If NULL, then default values are used.

asCRS

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

Details

The function does its best to fill in information. So if the datum is any of WGS84, NAD83, or NAD27, the the string +no_defs is attached to the PROJ.4 string. Definitions are also attached if they are specified in rgdal::projInfo('datum').

Value

Object of class CRS or character.

See Also

getCRS

Examples

1
2
3
4
5
# Lambert azimuthal equal-area
makeCRS('laea', long0=10, lat0=52) # for Europe
makeCRS('laea', long0=-96, lat0=37.5) # for North America
# Albers equal-area conic for North America
makeCRS('albers', long0=-96, lat0=37.5, lat1=29.5, lat2=45.5)

adamlilith/birdsEye documentation built on May 23, 2020, 4:40 p.m.