[R-sig-Geo] converting dataframe to rasterformate
pmagdon at gwdg.de
Thu Mar 8 17:50:58 CET 2007
First of all thank you very much for this comments.
As you already stated the points have to be regular spaced.
I expected them to be regular, because the dataset was created with the
pixel to ascii function within Erdas Imagine.
But I got the following error notice:
gridded(qb.train) <- TRUE
suggested tolerance minimum: 0.838128330817305Fehler in
points2grid(points, tolerance) : dimension 1 : coordinate intervals are
How can they become irregular, I was not changing the X &Y columns?
Roger Bivand schrieb:
> On Thu, 8 Mar 2007, Paul Magdon wrote:
>> I'm using R for classifying remote sensed data. I finally managed to apply
>> different knn-methods to the data. Now I have a Dataframe with X, Y, and Z
>> X Y Z
>> 475477.1 7485303.29 46.62
>> Is there an easy way to export such dataframe into am Esri compatible
>> format like Arcgrid, img, tiff etc.??
> Yes, for example:
> coordinates(meuse.grid) <- c("x", "y")
> gridded(meuse.grid) <- TRUE
> fullgrid(meuse.grid) <- TRUE
> writeGDAL(meuse.grid["dist"], "dist.tif", drivername="GTiff")
> This of course will not work if the points are not regularly spaced;
> there are plenty of different drivers for GDAL. For OSX either install
> rgdal on GDAL/PROJ.4 from source (see Rgeo site linked from Spatial Task
> View on CRAN for details) or write an Arc ASCII grid using
> writeAsciiGrid() in the maptools package, which does not depend on
> external libraries.
>> Many thanks,
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
More information about the R-sig-Geo