I have a float type raster file (an NDVI made from ERDAS IMAGINE) and would like to convert it to an interger type raster file in order to use Focal Statistics function (Majority). Is there any way to do this?
Menno's answer will work but it will work but it will always round down. For example, 99.99999 becomes 99.
This function in the raster calculator or map algebra tool will do logical rounding.
Int(yourraster + 0.5).
This way 99.99999 becomes 100 and and 99.49999 becomes 99.
From the fact that you plan to use focal statistics I infer that you must be able to use the spatial analyst extension.
In the spatial analyst toolbox there is a tool Int in the Math toolset which converts a floating point raster to an integer raster.
You need to stretch the NDVI floating point values (-1 to 1) to 8-bit unsigned (0 - 255). If you convert the float to integer directly, the resulting raster will have only one integer value. You can stretch the values in the Raster Calculator using the following equation:
(NDVI - -1) * 255 / (1 - -1) + 0
I use raster calculator all the time for mapping riverine floodplains.
I found that when I turned a raster set into an integer raster set by using Int () in the raster calculator that I lost information.
In order to avoid the likelihood of this happening, I would advise to use Con () instead to convert all values to a single integer value of your choosing and then converting that product to a polygon using raster to polygon conversion.