Friday 3 May 2019

arcgis desktop - Specifying pixel depth in ModelBuilder?



I have a simple model that calculates the NDVI from bands 3 and 4 of a raster dataset. The input bands are 8-bit unsigned, whereas the default output NDVI is signed 32 bit.


How can I specify the pixel depth for the output NDVI as 8 bit unsigned?


enter image description here



Answer



The result from NDVI will be continuous (i.e. decimal) values between -1 to +1, therefore the raster must be able to store these values, and will use signed pixel depth. If you truly want 8-bit unsigned, you will need to adjust the expression in the raster calculator by linearly scaling to values between 0-255 and then applying the int() function on the entire calculation. However, this still does not guarantee that the output will be 8-bit unsigned. Perhaps try Copy Raster on the scaled raster with the optional pixel_type parameter in your model to help with this.


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