Apply an affine transformation

geo_transform(x, trans, ...)

# S3 method for default
geo_transform(x, trans, ...)

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

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

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

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

# S3 method for 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

geo_transform( "POINT (30 10)", # translation +12 +13 matrix(c(1, 0, 0, 0, 1, 0, 12, 13, 1), ncol = 3) )
#> <wk_wkt[1]> #> [1] POINT (42 23)
geo_transform( geo_nc, # translation +12 +13 matrix(c(1, 0, 0, 0, 1, 0, 12, 13, 1), ncol = 3) )[c("NAME", "geometry")]
#> # A tibble: 100 x 2 #> NAME geometry #> <chr> <wk_wkb> #> 1 Ashe <SRID=4267;MULTIPOLYGON (((-69.4728 49.2344, -69.5408 49.2725, -… #> 2 Alleghany <SRID=4267;MULTIPOLYGON (((-69.2399 49.3654, -69.2407 49.3794, -… #> 3 Surry <SRID=4267;MULTIPOLYGON (((-68.4563 49.2426, -68.4764 49.2547, -… #> 4 Currituck <SRID=4267;MULTIPOLYGON (((-64.009 49.3196, -64.0173 49.3377, -6… #> 5 Northampton <SRID=4267;MULTIPOLYGON (((-65.2177 49.241, -65.2346 49.2146, -6… #> 6 Hertford <SRID=4267;MULTIPOLYGON (((-64.7451 49.2339, -64.9807 49.2302, -… #> 7 Camden <SRID=4267;MULTIPOLYGON (((-64.009 49.3196, -63.9572 49.1938, -6… #> 8 Gates <SRID=4267;MULTIPOLYGON (((-64.5625 49.3406, -64.6042 49.315, -6… #> 9 Warren <SRID=4267;MULTIPOLYGON (((-66.3088 49.26, -66.2829 49.2919, -66… #> 10 Stokes <SRID=4267;MULTIPOLYGON (((-68.0257 49.2502, -68.453 49.2571, -6… #> # … with 90 more rows