Description Usage Arguments Value Examples
Transform Coordinate Reference Systems
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | crs_transform(
handleable,
crs_to,
crs_from = wk::wk_crs(handleable),
engine = crs_engine(),
...
)
crs_transform_pipeline(handleable, pipeline, engine = crs_engine(), ...)
crs_set_longlat(handleable, datum = NULL, engine = crs_engine())
crs_set(handleable, crs_to)
crs_get(handleable)
|
handleable |
A geometry vector (e.g., |
crs_to |
Source and destination coordinate reference systems |
crs_from |
Source and destination coordinate reference systems |
engine |
A transform engine such as |
... |
engine-specific transformation options |
pipeline |
A character vector representing a PROJ coordinate operation |
datum |
A crs or datum (e.g., WGS84) to use for a long/lat definition |
A modified handleable
with crs_to
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | engine <- crs_engine_fun()
engine <- crs_engine_fun_define(engine, "EPSG:3857", "OGC:CRS84", function(coords) {
r <- 6378137
coords$x <- coords$x * pi / 180 * r
coords$y <- log(tan(pi / 4 + coords$y * pi / 180 / 2)) * r
coords
})
obj <- wk::xy(-64, 45, crs = "OGC:CRS84")
crs_transform(obj, "EPSG:3857", engine = engine)
with_crs_engine(engine, {
crs_transform(obj, "EPSG:3857")
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.