Re: [R-sig-Geo] Changing the coordinates of a SpatialGridDataFrame

2010-10-31 Thread David.Clifford
Big thanks to all the respondents for their help with my problem last week. Based on their suggestions it seems that the way to solve my problem is to use the following commands: gp <- gridparameters(obj) gp <- round(gp,3) GT <- with(gp, GridTopolopy(cellcentre.offset, cellsize, cells.dim)) obj

Re: [R-sig-Geo] Changing the coordinates of a SpatialGridDataFrame

2010-10-29 Thread Kamran Safi
Hi, why don't you do: temp<- as.data.frame("your grid") temp$lon <- round(temp$lon, 3) temp$lat <- round(temp$lat, 3) "your grid" <- temp coordinates("your grid") <- ~lon+lat gridded("your grid") <- TRUE This can be done with less command lines, just wanted to make the interpretation easier.

Re: [R-sig-Geo] Changing the coordinates of a SpatialGridDataFrame

2010-10-28 Thread Michael Sumner
Probably the best way to do this is to modify the GridTopology and recreate the grid. The coordinates of a SpatialGridDataFrame are calculated from the 6 values of the grid topology, only SpatialPixelsDataFrame stores every cell coordinate (possibly sparsely). It's best to recreate the object, ot

[R-sig-Geo] Changing the coordinates of a SpatialGridDataFrame

2010-10-28 Thread David.Clifford
Hi there, I have a SpatialGridDataFrame object and I wish to round the coordinates associated with the grid to three decimal places in order to match points in this object with points on another spatial object where the coordinates are recorded to three decimal places. Some information about