proj_trans_create {PROJ}R Documentation

Create a transformation object

Description

Creates a transformation object that transforms coordinates in a wk pipeline.

Usage

proj_trans_create(source_crs, target_crs, use_z = NA, use_m = NA)

Arguments

source_crs, target_crs

Source/Target CRS definition, coerced with wk::wk_crs_proj_definition()

use_z, use_m

Used to declare the output type. Use TRUE to ensure the output has that dimension, FALSE to ensure it does not, and NA to leave the dimension unchanged.

Value

A PROJ transformation object

Examples

(trans <- proj_trans_create("EPSG:4326", "EPSG:3857"))
wk::wk_transform(wk::xy(1:5, 1:5), trans)

library(wk)
(invtrans <- wk_trans_inverse(trans))

h <- 1852 * 60
## the stretch of Mercator to a square
wk::wk_transform(wk::xy(c(-h * 180, 0, h * 180), c(-h * 180,0, h * 180)), invtrans)


[Package PROJ version 0.5.0 Index]