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

Manuel Spínola m@p|no|@10 @end|ng |rom gm@||@com
Mon Jun 7 16:12:02 CEST 2021


Thank you very much Edzer,

I am working with a raster file of land cover from the Copernicus Global
Land Service that is 100m resolution but the file is in a regular
latitude/longitude grid (EPSG:4326).

How can I project this file to UTM keeping the 100m resolution?

You told me to go with st_warp but when I did that I got the following
error.

raster_utm <- st_warp(land_cover, crs = 5367)

Error in matrix(seq_len(prod(dims[dxy])), dims[dxy[1]], dims[dxy[2]])[xy] :
subscript out of bounds


I am missing an argument?

How can I specify the target grid template?

Manuel

El lun, 7 jun 2021 a las 1:02, Edzer Pebesma (<edzer.pebesma using uni-muenster.de>)
escribió:

>
>
> 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
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
*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]]



More information about the R-sig-Geo mailing list