Thanks Barry! I will look into it - for now i have my clumsy code and because my dataset is relatively small it does not matter, but for future this might not be the case. Monica
---------------------------------------- > Date: Thu, 13 Aug 2009 15:03:38 +0100 > Subject: Re: [R-sig-Geo] creating a geotiff > From: [email protected] > To: [email protected] > CC: [email protected] > > On Thu, Aug 13, 2009 at 1:35 PM, Monica Pisica wrote: >> >> Hi, >> >> I have some data as it is required for the function "image" {graphics}, that >> means a vector x for x coord, a vector y for y coord and a matrix m with x >> rows and y cols. I want to save this as a geotiff. If i transform my data to >> take the form of a 3 column data.frame i can use gridded and writeGDAL to >> obtain my geotiff, but sincerely it seems a little silly to do that. Is >> there any other way in doing it??? I've tried to transform this data in one >> of the sp objects but .... i was not able to. Any ideas?? > > Looking at the code for writeGDAL, it calls create2GDAL which [[elided Hotmail spam]] > > for (i in 1:nbands) { > band = as.matrix(dataset[i]) > > It should be possible to write something like create2GDAL that > operates on a list(x,y,z) structure and avoid converting to sp-classes > and than back to matrix form. You just need to work out what > gridparameters(xyzlist) looks like, and then it's a simple cut n paste > job... > > Actually, I think I did start doing that, but I can't find the code at > the moment.... > > Barry _________________________________________________________________ _sync:082009 _______________________________________________ R-sig-Geo mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
