Friday 19 July 2019

ArcGIS 10.3 Build Raster Attribute Table fails for large rasters


I am looking at forest loss in Central and South America within protected and unprotected areas. So I have a binary raster (0 or 1) for forest in 2000 and another raster for forest in 2013. I want to use Zonal Statistics as Table to look at forest loss in each country in protected and unprotected areas (which I have a polygon shapefile for). However, Zonal Stats as Table fails saying it couldn't build attribute table.


When I try to use the Build Raster Attribute Table tool it fails and gives the following error: "Error 000049: Failed to build attribute table." Clicking on the error it says that the rasters need to be integer and single band. But both of my rasters are in GRID format and are single-band, unsigned integer (8 bit).


When I tried clipping the rasters (~500-600MB) into smaller pieces, one for Central America (CA) and one for South America (SA), then the attribute table was automatically built for CA (~60MB), but not SA (~300MB). With the attribute table for CA, I was able to complete my analysis with Zonal Stats as Table. Unfortunately, the Build Raster Attribute Table still fails for the clipped SA raster.


I figured that maybe the raster is still too big, so I clipped the SA raster into two pieces (133MB and 174MB), however the tool still fails on both. I could keep clipping the raster until it is small enough, but that is extremely annoying and inconvenient for the rest of my analysis. Am I doing something wrong with Building the attribute table? There aren't really many options in the tool besides input raster and then overwrite or not (I've tried both ways, doesn't matter).



I've tried turning off Background Geoprocessing, removed and re-added the rasters, tried restarting ArcGIS, and the computer, but same result. Could this be a problem with ArcMap 10.3? I could have sworn that I've dealt with larger rasters than 600MB before in earlier versions, and it was slow but still worked.



Answer



The problem with building a raster attribute table (RAT) has to do with the format used to store the values. RAT files are stored as .dbf files that support a maximum of 32 bit integers which has a higher limit of 2,147,483,647. If there is a cell value with a count that exceeds this number the RAT cannot be built.


There is no workaround.. Esri only supports integer field types of short int (16 bit) and long int (32 bit) which means Cell Counts cannot exceed 2 billion in any individual raster. If you need this functionality please submit an improvement request with Esri international.


You might be able to tile the raster, build RAT on the tiles and then build a mosaic dataset/VRT with attributes (don't trust count).


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...