Description Usage Arguments Details Value References Examples
A raw interface to 'proj_trans' in 'PROJ => 6', if it is available.
1 2 3 | proj_trans(x, target, ..., source = NULL, z_ = NULL, t_ = NULL)
proj_trans_generic(x, target, ..., source = NULL, z_ = 0, t_ = 0)
|
x |
input coordinates (x,y, list or matrix see |
target |
projection for output coordinates |
... |
ignored |
source |
projection of input coordinates (must be named) |
z_ |
optional z coordinate vector |
t_ |
optional t coordinate vector |
'proj_trans_generic()' and 'proj_trans()' have the same arguments, but differ
in the default values of z_
and t_
, 0
or NULL
. 'proj_trans_generic()' always
returns a list for 4 elements, 'proj_trans()' will return 2 or 4 depending on the input.
'proj_trans_generic()' is a misnomer in that 'proj_trans' is the function from the PROJ library that is now used.
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
so it's pretty flexible.
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".
list of transformed coordinates, with 4-elements x_
, y_
, z_
, t_
see the PROJ library documentation for details on the underlying functionality
1 2 3 | # proj_trans(cbind(147, -42), "+proj=laea", source = "epsg:4326")
#proj_trans(cbind(147, -42), z_ = -2, "+proj=laea", source = "epsg:4326")
#proj_trans(cbind(147, -42), z_ = -2, t_ = 1, "+proj=laea", source = "epsg:4326")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.