Skip to content
Prev 28570 / 29559 Next

Simple doubt - CRS

Hello everyone,

I'm extracting a precipitation data of a raster to shapefile and have a simple doubt.

To extract I'm transforming my shape to the crs of the rasterstack to get the same crs.

What I'm concerned about is that before and after the changing in the crs when I ask for the function proj4string I have a warning:

"In proj4string(shape) : CRS object has comment, which is lost in output"

I read that it's because of the development of the rgdal and that in most cases there is no problem. But I would like confirmation that this is not affecting my results of extraction. I believe that if the warning came after the extraction, I should be more concerned. Could anyone help?

The code Is like that:

shape <- readOGR(dsn = ".", layer = "myshape")

proj4string(shape)

fn<-file.path("mypath\\cru_ts4.04.2011.2019.pre.dat.nc")

rasbrick <- stack(fn)

shape2<- spTransform(shape, crs(rasbrick))

proj4string(shape2)

for (i in 1:length(rasbrick at layers)) {
  weath_dt[,2+i] = raster::extract(rasbrick[[i]], shape2, mean, na.rm=T)
}

Thanks.

Pietro Andre Telatin Paschoalino
Doutorando em Ci?ncias Econ?micas da Universidade Estadual de Maring? - PCE.