Re: [R-sig-Geo] Count frequency of values in a rasterbrick object

2012-08-28 Thread Thiago Veloso
  Robert,   Thank you very much for the help - it works.    Also, thanks for adding this function to your package - it will certainly be very useful.   Regards,   Thiago. From: Robert J. Hijmans Cc: R-SIG list Sent: Friday, August 24, 2012 6:09 PM Subject

[R-sig-Geo] problems writing a tiff file with georeferencing

2012-08-28 Thread cpadwick
Hi, I want to read an existing geotiff file (with georeferencing info), operate on the raster data, and write out the result to a Float32 file. I'm working with hyperion data which is Integer. This code creates an outputfile, however, the output file t1.tif is Integer. I need it to be float. fn

Re: [R-sig-Geo] problems writing a tiff file with georeferencing

2012-08-28 Thread Robert J. Hijmans
You can use readGDAL and writeGDAL. If you really need lower level gdal functions you can look at the code of these functions. you can also use functions from 'raster': library(raster) r <- raster(fname) x <- r * 2 x <- writeRaster( x, "t1.tif") plot(x) On Tue, Aug 28, 2012 at 5:27 AM, cpadwick

[R-sig-Geo] Geographical CRS given to non-conformant data:

2012-08-28 Thread Chris English
Hi, Trying to make a SpatialPoints(obj) and encounter the following: > out_dest_sp <- SpatialPoints(out_dest, proj4string=proj) Error in validityMethod(as(object, superClass)) : Geographical CRS given to non-conformant data: -173.07856 > bbox(out_orig_spdf) min ma

Re: [R-sig-Geo] How to speed up calculating proportion of landcover classes falling within larger pixels?

2012-08-28 Thread Lyndon Estes
Hi Robert, Just wanted to report back on the solution you gave me, which worked perfectly as you wrote it. >> library(raster) >> >> library(rgdal) >> >> r <- raster(ncol=10, nrow=10) # EP MODIS pixels >> eplc <- raster() >> set.seed(0) >> eplc[] <- round( runif(ncell(eplc)) + 3) >> eplc[1:1

[R-sig-Geo] Coordinate interpolation keeping NAs

2012-08-28 Thread Mario A. Pardo
Greetings, I'm sorry if this question is too basic, but I just recently moved to R. Let's say I have: lon <- c(-115.86, -115.83, NA, -115.78, -115.78, -115.75, NA, -115.68, -115.66) lat <- c( 29.76, 29.61, NA, 29.55, 29.53, 29.41, NA, 29.13, 29.09) and I need a new set of coordin

Re: [R-sig-Geo] Coordinate interpolation keeping NAs

2012-08-28 Thread Tom Gottfried
Mario, Am 29.08.2012 01:38, schrieb Mario A. Pardo: Greetings, I'm sorry if this question is too basic, but I just recently moved to R. Let's say I have: lon <- c(-115.86, -115.83, NA, -115.78, -115.78, -115.75, NA, -115.68, -115.66) lat <- c( 29.76, 29.61, NA, 29.55, 29.53, 29.41, NA, 29.13,