proj_trans {PROJ} | R Documentation |
Transform coordinates
Description
Transforms all coordinates in x
using wk::wk_handle()
and proj_trans_create()
.
Usage
proj_trans(x, target_crs, source_crs = NULL, ..., use_z = NA, use_m = NA)
Arguments
x |
Input geometry/geography. May take any of the following forms:
|
source_crs , target_crs |
Source/Target CRS definition, coerced with |
... |
Additional parameters forwarded to |
use_z , use_m |
Used to declare the output type. Use |
Details
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
Transformed geometries whose format is dependent on input.
References
see the PROJ library documentation for details on the underlying functionality
Examples
proj_trans(cbind(147, -42), "+proj=laea +type=crs", "EPSG:4326")
proj_trans(cbind(147, -42, -2), "+proj=laea +type=crs", "EPSG:4326")
proj_trans(cbind(147, -42, -2, 1), "+proj=laea +type=crs", "EPSG:4326")
proj_trans(wk::xy(147, -42, crs = "EPSG:4326"), "+proj=laea +type=crs")
proj_trans(wk::wkt("POLYGON ((1 1, 0 1, 0 0, 1 0, 1 1))", crs = "EPSG:4326"), 3112)