[R-sig-Geo] Reprojection doubt

Pietro Andre Telatin Paschoalino P|etro_te|@to @end|ng |rom hotm@||@com
Fri Nov 6 02:11:21 CET 2020


Dear,

I have a question that is possibly extremely easy for you.

I'm extracting data from layers of grid to a shape file.

To do this, first, I know that I need to reproject the coordinates reference system of my shape to the same CRS as my grid. The code for this is:

library(ncdf4)

fn<-file.path(path of my data)

ncfile <- nc_open(fn)

rasbrick <- stack(fn)

rasbrick <- brick[[70:81]] (the layers that I want)

shape2<- spTransform(shape, crs(rasbrick)) in lowercase, right?  It is my first question.

The rest of the extraction code works without any problems. If I open this file in qgis the CRS is:

OGC:CRS84 - WGS 84 (CRS84) - Geographic

The problem is that if I write a raster of a layer using:

rasbrick <- brick[[70]]

writeRaster(rasbrick, "test.tif", format="GTiff")

and open the raster in qgis the CRS is:

EPSG:4326 - WGS 84 - Geographic

So, my second question is why on the raster it looks like EPSG and on the shape it looks like OGC? And could this cause any problems in extracting data from layers for the shape? If yes, what I need to change to reproject the shape for the correct CRS?

Thanks.

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

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list