Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
    
Can this be controlled with an environment setting? –  L_Holcombe Feb 12 '13 at 15:43
    
I haven't found a way to specify the pixel depth in the environment settings. –  Aaron Feb 12 '13 at 16:03
    
Does the calculator exhibit behavior that changes the pixel depth? –  gm70560 Apr 30 '13 at 21:38
    
No as this is part of a model so I need to keep the image with the original 8 bit, do the calculations, convert it into 32bit and do some other calculations and then output it. The problem is to keep it at 8 bit for the first set of calcs. –  John Apr 30 '13 at 22:03
    
Would you be able to edit your question to include this clarification to it, please? –  PolyGeo Jul 23 '13 at 23:12
add comment

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
add comment

After running Raster Calculator, use the Copy Raster tool with the pixel_type parameter set to 8_BIT_UNSIGNED, as shown below.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.