stars (version 0.0)

st_transform.stars: transform features, or warp/resample grids in stars objects to a new coordinate reference system

Description

transform features, or warp/resample grids in stars objects to a new coordinate reference system

Usage

# S3 method for stars
st_transform(x, crs, ..., cellsize = NA_real_,
  segments = NA_integer_)

Arguments

x

object of class stars, with either raster or simple feature geometries

crs

object of class crs with target crs, or object of class stars with target grid

...

passed on

cellsize

cellsize in target coordinate reference system

segments

number of (total) segments to segmentize the bounding box before transforming to new crs

See Also

st_transform

Examples

Run this code
# NOT RUN {
geomatrix = system.file("tif/geomatrix.tif", package = "stars")
(x = st_stars(geomatrix))
new = st_crs(4326)
y = st_transform(x, new)
plot(st_transform(st_as_sfc(st_bbox(x)), new), col = NA, border = 'red')
plot(st_as_sfc(y, as_points=FALSE), col = NA, border = 'green', axes = TRUE, add = TRUE)
image(y, add = TRUE)
plot(st_as_sfc(y, as_points=TRUE), pch=3, cex=.5, col = 'blue', add = TRUE)
plot(st_transform(st_as_sfc(x, as_points=FALSE), new), add = TRUE)
# }

Run the code above in your browser using DataLab