[R-sig-Geo] Set output data type for projectRaster

2015-07-07 Thread Ned Horning
Hi all - I am trying to project a raster using the projectRaster() function from the raster package and would like the data type for the output image to be the same as the data type of the input image (INT2U Landsat 8 image stack). For some reason I get an output data type of FLT8S, even when

Re: [R-sig-Geo] More problems with sampleRandom using and extent

2014-03-25 Thread Ned Horning
04:35 PM, Ned Horning wrote: Hi - I had a problem a while back using sampleRandom with an extent object to limit sampling within the extent and I thought it was fixed but now there seems to be another problem. When I run sampleCells - sampleRandom(predImage, size=20, sp=TRUE, ext=commonExt) I

[R-sig-Geo] More problems with sampleRandom using and extent

2014-03-19 Thread Ned Horning
Hi - I had a problem a while back using sampleRandom with an extent object to limit sampling within the extent and I thought it was fixed but now there seems to be another problem. When I run sampleCells - sampleRandom(predImage, size=20, sp=TRUE, ext=commonExt) I get the following warnings

Re: [R-sig-Geo] Error with disaggregate

2014-02-18 Thread Ned Horning
a datatype (FLT4S) argument c - disaggregate(b, fact=32, filename='dis.tif', datatype='FLT4S') Or if you set rasterOptions(chunksize= ) temporarily to something lower. I note that I should add a block_fun method to do this in one step Robert On Tue, Feb 18, 2014 at 9:47 AM, Ned Horning horn

[R-sig-Geo] Problem with cell numbers when using a raster extent object

2013-11-25 Thread Ned Horning
Hi - I have a script that calculates a common extent between two images than then uses the resulting extent to restrict the random selection of cells from a raster using the “sampleRandom” function. I use the following function: sampleCells - sampleRandom(predImage, size=numSamps,

Re: [R-sig-Geo] Problem with cell numbers when using a raster extent object

2013-11-25 Thread Ned Horning
- xyFromCell(r, s) plot(e) plot(r, add=T, legend=F) points(xy) On Mon, Nov 25, 2013 at 9:42 AM, Ned Horning horn...@amnh.org wrote: Hi - I have a script that calculates a common extent between two images than then uses the resulting extent to restrict the random selection of cells from a raster using

Re: [R-sig-Geo] Alternative to zonal for large images

2013-02-13 Thread Ned Horning
Thanks to everyone who responded to my question. This morning I tried the approach suggested by Oscar Perpiñán Lamigueiro and was very impressed. It is very fast, didn't consume excessive memory, and it provides enough flexibility to use different statistics. It also introduced me to the

[R-sig-Geo] Alternative to zonal for large images

2013-02-11 Thread Ned Horning
Hi - Are there alternatives to using the raster package zonal function for large images when using functions for the stat parameter? The canned functions like 'mean' work well but I would like to write my own functions to calculate standard deviation and other statistics. I tried extract

Re: [R-sig-Geo] Random Forest Classifier

2011-10-26 Thread Ned Horning
Hi Mohammed, I recently posted some random forests R scripts and guides on our web site:http://biodiversityinformatics.amnh.org/. On the site go to Open Source Resources = CBC Developed Resources. If you download and use these tools I would appreciate your feedback. I still need to upload this

[R-sig-Geo] Problem with gain/offset and sampleRegular

2011-10-07 Thread Ned Horning
Hi - I am working on a topographic correction script and am having a problem with the gain and offset settings. This is how I set the gain and offset: gainVal - 0.108078 offsetVal - -0.37 gain(satImage) - gainVal offs(satImage) - offsetVal When I look at the gain/offset values they look fine:

[R-sig-Geo] Multiple NAvalue for extract

2011-10-06 Thread Ned Horning
Hi - I am trying to extract values from image cells using the raster package extract function: classCellValues - extract(classImage, classCellNumbers) The image that I am using has two do-data values that I set using NAvalue. When I run extract I get lot of the following warnings: In if

[R-sig-Geo] Feature space plotting

2011-06-24 Thread Ned Horning
Hi - Before I embark to develop a script to create feature space plots of two image bands I was wondering if anyone was aware of a package that provides this capability. I would like to be able to plot pixel values from one image band on the X-axis and pixel values from the another band on the

[R-sig-Geo] spsample taking excessive memory

2011-04-29 Thread Ned Horning
Hi - I am trying to select 1000 random samples from each set of ESRI Shapefile polygons with the same attribute value (attName). This has worked well in the past with other shapefiles. The file I'm using now has 69 relatively simple polygons with 9 unique values for the attribute I'm using

[R-sig-Geo] Error in .GDALnodatavalue(dataformat)

2011-02-22 Thread Ned Horning
Hi - I am getting the following error when I run aggregate (from the raster package) on a raster image and output to a file. Error in .GDALnodatavalue(dataformat) : cannot find matching nodata value This is the command I am running: aggregate(inImg, fact=40, fun=varPercent,

Re: [R-sig-Geo] satellite imagery

2010-12-05 Thread Ned Horning
Hi Nick, The Raster package has been my key to working with images in R. Leveraging the Raster package you can use just about any classification engine or statistics queries you want. I've been quite impress with the RandomForest package (among others) for image classification. I'm happy to