geo_transform: Apply an affine transformation

Description Usage Arguments Value Examples

View source: R/geo-transform.R

Description

Apply an affine transformation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
geo_transform(x, trans, ...)

## Default S3 method:
geo_transform(x, trans, ...)

## S3 method for class 'wk_wkt'
geo_transform(x, trans, ...)

## S3 method for class 'wk_wkb'
geo_transform(x, trans, ...)

## S3 method for class 'wk_wksxp'
geo_transform(x, trans, ...)

## S3 method for class 'geovctrs_xy'
geo_transform(x, trans, ...)

## S3 method for class 'geovctrs_segment'
geo_transform(x, trans, ...)

Arguments

x

A geometry-like object, or one that can be coerced to a geometry-like object using as_geovctr().

trans

A 3x3 transformation matrix describing an affine transformation of the input.

...

Unused

Value

A transformed x

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
geo_transform(
  "POINT (30 10)",
  # translation +12 +13
  matrix(c(1, 0, 0, 0, 1, 0, 12, 13, 1), ncol = 3)
)

geo_transform(
  geo_nc,
  # translation +12 +13
  matrix(c(1, 0, 0, 0, 1, 0, 12, 13, 1), ncol = 3)
)[c("NAME", "geometry")]

paleolimbot/geovctrs documentation built on July 30, 2020, 3:41 p.m.