[R-sig-Geo] How to project a SpatExtent object?

Michael Sumner md@umner @end|ng |rom gm@||@com
Tue Jul 6 02:00:18 CEST 2021


I think you can project the empty rast() object, using the same idiom as
{raster} to create an empty version:

 f <- system.file("ex/elev.tif", package="terra", mustWork = TRUE)
 r <- rast(f)
terra::project(terra::rast(r), "+proj=laea")

that seems analogous to what raster::projectExtent does.

HTH, Mike



On Tue, Jul 6, 2021 at 6:14 AM Tim Elrick <abo using elrick.de> wrote:

> Hi all,
>
> Does anyone know how to (re-)project a SpatExtent object from the terra
> package?
>
> project() only works on SpatVector or SpatRaster, but vect() doesn't
> work on a SpatExtent either to convert a SpatExtent to a SpatVector.
>
> Thanks,
>
> Tim
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsumner using gmail.com

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list