Friday 28 September 2018

Building raster with multiple attributes based on 3 input rasters?



I am trying to make a new raster based on three input rasters which have the same cell size and the grids align perfectly.


I now want to construct a new raster, which for each cell, has three attributes, being the cell the values of the different input rasters. I've read about using 'combine', but this provides with an attribute table with a count of all cells with the same combination of values in the different input rasters (I hope this is clear). What I need is an attribute table in which all cells are individually represented.


Does anyone have any advice on this?



Answer



In the vector data model you have the geometry and the attributes stored separately but when you're working with raster datasets the raster is both the geometry and the attribute table in one. A raster is essentially a table where each grid cell is assigned one and only one value. To create a table with entries for each grid cell in the raster would require as much or more (if row and column indices must be stored explicitly) disc space than would be used to create three separate rasters. In the raster data model, multiple rasters are used to store multiple fields. A raster attribute table really is only effective for qualitative (categorical) rasters. Otherwise there is nothing gain in using a table. So, the simple answer is that you could theoretically do what you are asking to do but it wouldn't make any sense to do so.


Of course there are a few exceptions to the rule that one grid cell in a raster can only store one value. A common one that GISers tend to run into is the FD8 flow pointer, which uses combinations of base-2 numbers to store multiple flow directions pointing towards up to 8 different neighbours. But this is a rather specialized and limited case. Another one would be a colour composite in which three bands of 8-bit data (red, green, blue) are stored in the raster as a single value and then are parsed when the image is read. Again, this limits the data from the three data sources to a narrow numerical range (integers from 0 to 255). A third scenario where this is achieved would be to use a raster format that allows for multiple bands (e.g. BIL, BSQ, BIP, TIFF, etc.). Again however this is essentially a wrapper for multiple raster and all three rasters still exist; they're just contained within a single file. My advice is this, disc space is cheap and modern operating systems have wonderful file management systems. Don't be afraid to create folders with dozens of individual raster images...it's the raster GIS way :)


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...