proj_trans {PROJ}R Documentation

Transform a set of coordinates with 'PROJ'

Description

A raw interface to 'proj_trans' in 'PROJ => 6', if it is available.

Usage

proj_trans(x, target, ..., source = NULL, z_ = NULL, t_ = NULL)

Arguments

x

input coordinates (x,y, list or matrix see z_ and t_)

target

projection for output coordinates

...

ignored

source

projection of input coordinates (must be named i.e. 'source = "<some proj string"' can't be used in positional form)

z_

optional z coordinate vector

t_

optional t coordinate vector

Details

Input 'x' is assumed to be 2-columns of "x", then "y" coordinates. If "z" or "t" is required pass these in as named vectors with "z_" and "t_". For simplifying reasons z_ and t_ must always match the length of x y. Both default to 0, and are automatically recycled to the number of rows in x.

Values that are detected out of bounds by library PROJ are allowed, we return Inf in this case, rather than the error "tolerance condition error".

Value

list of transformed coordinates, with 4- or 2-elements x_, y_, z_, t_

References

see the PROJ library documentation for details on the underlying functionality

Examples

if (ok_proj6()) {
 proj_trans(cbind(147, -42), "+proj=laea", source = "OGC:CRS84")
 proj_trans(cbind(147, -42), z_ = -2, "+proj=laea", source = "OGC:CRS84")
 proj_trans(cbind(147, -42), z_ = -2, t_ = 1, "+proj=laea", source = "OGC:CRS84")
 }

[Package PROJ version 0.4.5 Index]