inla.CRS: Create a coordinate reference system object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/spmesh.R

Description

Creates either a CRS object or an inla.CRS object, describing a coordinate reference system

Usage

1
2
inla.CRS(projargs = NA_character_, doCheckCRSArgs = TRUE,
         args = NULL, oblique = NULL, ...)

Arguments

projargs

Either 1) a projection argument string suitable as input to sp::CRS, or 2) an existing CRS object, or 3) a shortcut reference string to a predefined projection (longlat, lambert, mollweide, hammer, and sphere).

doCheckCRSArgs

default TRUE, must be set to FALSE by package developers including CRS in an S4 class definition to avoid uncontrolable loading of the rgdal namespace.

args

An optional list of name/value pairs to add to and/or override the PROJ4 arguments in projargs. name=value is converted to "+name=value", and name=NA is converted to "+name".

oblique

Vector of length at most 4 of rotation angles (in degrees) for an oblique projection, all values defaulting to zero. The values indicate (longitude, latitude, orientation, orbit), as explained in the Details section below.

...

Additional parameters. Not currently in use.

Details

The first two elements of the oblique vector are the (longitude, latitude) coordinates for the oblique centre point. The third value (orientation) is a counterclockwise rotation angle for an observer looking at the centre point from outside the sphere. The fourth value is the quasi-longitude (orbit angle) for a rotation along the oblique observers equator.

Simple oblique: oblique=c(0, 45)

Polar: oblique=c(0, 90)

Quasi-transversal: oblique=c(0, 0, 90)

Satellite orbit viewpoint: oblique=c(lon0-time*v1, 0, orbitangle, orbit0+time*v2), where lon0 is the longitude at which a satellite orbit crosses the equator at time=0, when the satellite is at an angle orbit0 further along in its orbit. The orbital angle relative to the equatorial plane is orbitangle, and v1 and v2 are the angular velocities of the planet and the satellite, respectively. Note that "forward" from the satellite's point of view is "to the right" in the projection.

When oblique[2] or oblique[3] are non-zero, the resulting projection is only correct for perfect spheres.

Value

Either an sp::CRS object or an inla.CRS object, depending on if the coordinate reference system described by the parameters can be expressed with a pure sp::CRS object or not.

An S3 inla.CRS object is a list, usually (but not necessarily) containing at least one element:

crs

The basic sp::CRS object

Author(s)

Finn Lindgren <finn.lindgren@gmail.com>

See Also

CRS, inla.CRSargs, plot.CRS, inla.identical.CRS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
if (require(rgdal)) {
  halfroot <- "+a=0.7071067811865476 +b=0.7071067811865476"
  crs1 <- inla.CRS("+proj=longlat +ellps=sphere +a=1 +b=1")
  crs2 <- inla.CRS("+proj=cea +ellps=sphere +lat_ts=0 +units=m +a=1 +b=1")
  crs3 <- inla.CRS(paste("+proj=moll +ellps=sphere +units=m", halfroot))
  crs4 <- inla.CRS(paste("+proj=hammer +ellps=sphere +units=m", halfroot))
  crs5 <- inla.CRS("+proj=geocent +ellps=sphere +a=1 +b=1 +units=m")
  ## Shortcuts:
  crs1 <- inla.CRS("longlat")
  crs2 <- inla.CRS("lambert")
  crs3 <- inla.CRS("mollweide")
  crs4 <- inla.CRS("hammer")
  crs5 <- inla.CRS("sphere")
}

inbo/INLA documentation built on Dec. 6, 2019, 9:51 a.m.