Derate a large ArcGIS grid file using a raster in R

I am trying to extract various attributes of a large ArcGIS grid file similar to this forestry map

Even using a smaller cropped version of the file, the operation is slow, but more importantly, it requires a lot of temporary GB file, which ultimately runs out of my hard drive, which leads to the failure of the operation. I have about 35 GB of free space on this drive.

foo <- raster("grid/w001001.adf")
allLayers <- deratify(foo)

Using the cropped version of the aforementioned file, you can extract one attribute level, but this still requires a temporary file with several GB when the cropped ArcGIS grid file directory is only ~ 160 MB. Specifying a file name in a function does not improve the amount of hard disk space used.

allLayers <- deratify(fooCropped, att="BA_GE_3")

I would like to extract several layers and then do pixel calculations using these attributes. Is there a way to extract an attribute table as a data framework, perform calculations, and relink it to a raster?

System Information:

> R.Version()
$platform
[1] "x86_64-apple-darwin15.3.0"
$arch
[1] "x86_64"
$os
[1] "darwin15.3.0"
$system
[1] "x86_64, darwin15.3.0"
...

‘raster’ version 2.5-2 
R version 3.2.4
+4
source share
1 answer

I run calculations based on flow temperature data, which often amounts to millions of records. Whenever I run into memory problems, I include the gc () and rm () functions in loops where I process the data. You can use these functions in your loop to process cropped files so that rm () removes unnecessary objects from the R environment, and gc () returns memory to your system.

, , , node looped deratify(). , .

0

All Articles