Skip to contents

Implements the Web-Mercator forward and inverse transforms exactly, so a round trip recovers the original coordinates. Attribute data and (the updated) CRS metadata are preserved.

Usage

morie_spatial_transform(x, to_crs)

Arguments

x

A morie_spatial.

to_crs

Target EPSG (4326 or 3857).

Value

A morie_spatial in the target CRS.

Examples

s <- morie_spatial(data.frame(lon = -79, lat = 43))
morie_spatial_transform(s, 3857)
#> <morie_spatial> n=1  EPSG:3857 (metres)