[R-sig-Geo] spTransform, gridded

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Sat Mar 24 20:07:33 CET 2007


Dear Listers,

I am trying to convert a Gtiff object  from a coordinate system to 
another... I have tried the following:

# read the Gtiff file (European Lambert azimuthal equal area)
fcE<-readGDAL("fclambert.tif")
proj4string(fcE) # CRS OK

# read a shapefile to get the projection system (Lambert II etendu - a 
French projection Lambert
# conformal conic based on NTF)
fccoms<-readOGR("U:/Documents and Settings/giraudoux/Mes documents/Map 
tools/Shapefiles checked prj","FC_communes")
proj4string(fccoms) # CRS OK

# transform
fcLIIe<-spTransform(fcE, CRS(proj4string(fccoms))) # looks OK

# try writing
writeGDAL(fcLIIe,"fcLIIe.tif")
Error: gridded(dataset) is not TRUE

# try to promote to a grid...
gridded(fcLIIe)<-TRUE
suggested tolerance minimum: 0.5Error in points2grid(points, tolerance) 
: dimension 1 : coordinate intervals are not constant

I  suspect that  pixel centers may have been distorted with the 
transformation but may naively I wonder if there is a way to turn this 
problem eg increasing the tolerance...

Any hint appreciated...

Patrick




More information about the R-sig-Geo mailing list