[R-sig-Geo] How to find project 4 string

alemante zd mintibezabih at gmail.com
Mon Oct 8 00:58:32 CEST 2012


Dear all,

This might be a very elementary question to most on here but I am
trying to construct a raster from my latitude/longtude data and while
I managed to get most codes right (with help from you guys), I could
not figure out what to put in place of "fill in the proj4 string you
want". Where do I get these figures from? I tried looking up the
location of Ethiopia where data for this exercise is from and came up
with this figure("+init=epsg:4326"). But when I insterted it , I was
not successful in fully running my code

Anyway, my full codes looks like below:


x <- 1:10

y <- 1:10

F1<-data.frame(x, y)

library(sp)

SP <- SpatialPoints(F1,proj4string=CRS("+proj=longlat"))


library(rgdal)

spt <- spTransform(SP, CRS("  fill in  the proj4 string you want  ") )


gridded(spt) = TRUE

library(raster)
r = raster(spt)
projection(r) = CRS("fill in  the proj4 string you want  ")
plot(r)

I would be most grateful for any help as usual.

Cheers
minti



More information about the R-sig-Geo mailing list