[R-sig-Geo] stars st_transform gives NA to the offset and delta parameters

Edzer Pebesma edzer@pebe@m@ @end|ng |rom un|-muen@ter@de
Mon Jun 7 09:01:12 CEST 2021



On 07/06/2021 01:16, Manuel Spínola wrote:
> Dear list members,
> 
> When using st_transform in a stars object the offset and delta parameters
> become NA, is this an expected behavior?

Yes, it also says that you got a curvilinear grid as a result, which is 
a grid with non-constant cell size (delta) and non-constant coordinate 
of the side (offset); see 
https://keen-swartz-3146c4.netlify.app/intro.html#raster-types

If you want a regular grid in the new CRS, use st_warp(), preferably 
with the target grid template.

> 
> 
> geomatrix = system.file("tif/geomatrix.tif", package = "stars")
> x = read_stars(geomatrix)
> 
> new = st_crs(4326)
> y = st_transform(x, new)
> y
> 
> 
> 
> 
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspinola using una.cr <mspinola using una.ac.cr>
> mspinola10 using gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081



More information about the R-sig-Geo mailing list