Transform the underlying sf object and all the MC replicas, if any.

# S3 method for sr_obs
st_transform(x, crs, ...)

Arguments

x

A sr_obs object created with sr_obs.

crs

Coordinate reference system: inteer with the EPSG code or character with proj4string

...

Ignored

Value

A sr_obs object in the target projection.

Examples

## Some observed data and MC replicates in longitude/latitude x <- sr_obs(data.frame(lat = 1, lon = 1, day = 1), "day", uq = sr_uq(2, 1, 1)) st_crs(x)
#> Coordinate Reference System: #> EPSG: 4326 #> proj4string: "+proj=longlat +datum=WGS84 +no_defs"
lapply(attr(x, "mc"), st_crs)
#> [[1]] #> Coordinate Reference System: #> EPSG: 4326 #> proj4string: "+proj=longlat +datum=WGS84 +no_defs" #> #> [[2]] #> Coordinate Reference System: #> EPSG: 4326 #> proj4string: "+proj=longlat +datum=WGS84 +no_defs" #>
xt <- st_transform(x, 3857) st_crs(xt)
#> Coordinate Reference System: #> EPSG: 3857 #> proj4string: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"
lapply(attr(xt, "mc"), st_crs)
#> [[1]] #> Coordinate Reference System: #> EPSG: 3857 #> proj4string: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs" #> #> [[2]] #> Coordinate Reference System: #> EPSG: 3857 #> proj4string: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs" #>