Much better!! 2009/9/3 Barry Rowlingson <b.rowling...@lancaster.ac.uk>
> 2009/9/3 Cutberto Uriel Paredes Hernández <cutberto.pare...@gmail.com>: > > Dear list, > > > > Is there a way to convert a raster to points in R > > (SpatialGridDataFrame to SpatialPointsDataFrame)? I know I can do this > > with ArcGIS but I would like not to use propietary software. > > Just build one from the coordinates and the data: > > > data(meuse.grid) > > m = SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data > = meuse.grid) > > class(m) > [1] "SpatialPixelsDataFrame" > > fullgrid(m)=TRUE > > class(m) > [1] "SpatialGridDataFrame" > > # now we have a SGDF, so convert to SPDF: > > mp=SpatialPointsDataFrame(coordinates(m),dat...@data) > > > class(mp) > [1] "SpatialPointsDataFrame" > > > names(m...@data) > [1] "x" "y" "part.a" "part.b" "dist" "soil" "ffreq" > > Barry > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo