About floating point and integer data
Integer raster data stores whole numbers as the values of each cell. Floating point raster data stores numbers with a decimal portion as the values of each cell. Integer values commonly represent categorical (discrete) data, and floating-point values commonly represent continuous surfaces. The graphics below show examples of floating-point (on the left) and integer (on the right) raster data. Note that when converting from floating-point to integer data, the values after the decimal point are simply truncated.
= NoData
Reasons to convert from floating-point data
- Some ArcGIS Spatial Analyst tools will not accept floating-point data as input. Examples include: CostAllocation (source data), CostBackLink (source data), CostDistance (source data), Zonal Statistics (zone dataset), and Weighted Overlay (input rasters).
- An attribute table is not generated for floating-point data. If you need an attribute table for your data, you can convert your floating-point data to integer. Converting to integer can result in a loss of information. Care must be taken if your floating-point values are between 0 and 1. The information content after the decimal place will be lost, as the values are truncated. To overcome this problem, first multiply the floating-point raster by a value, such as a factor of 10, so that all values are greater than 1, then convert to integer data. For example, at the Raster Calculator or in the Single Output Map Algebra tool, type:
Int([FloatRaster] * 10)
The values in the resultant integer raster, and any results created from this raster, will need to be interpreted accordingly, as they will no longer be the original values.
By converting your data from floating point to integer, the size of the raster dataset on disk and the memory usage will be reduced.
How to convert from floating-point to integer data
Using the Int tool
- On the Standard toolbar, click the Show/Hide ArcToolbox button to show ArcToolbox.
- Click the Index tab.
- Type "int (sa)" to locate the ArcGIS Spatial Analyst Int tool.
Learn more about the Int tool
- In the list, double-click the tool to open its dialog box.
Note that clicking Locate displays the location of the tool in the ArcToolbox Favorites list.
- In the table of contents, click the dropdown arrow and click the floating point layer to use as the input data. Alternatively, type the path to the input data on disk or click the Browse button to browse for the input data on disk.
- Type a name and location for the output integer raster, or click the Browse button to navigate to the location in which to save the result.
- Click OK.
Using Map Algebra via the Raster Calculator
- Add and enable the Spatial Analyst toolbar.
Learn more about adding and enabling the Spatial Analyst toolbar
- Click the Spatial Analyst dropdown arrow and click Raster Calculator.
- In the Expression box, type
Int([InRaster])
where InRaster is your input floating-point raster. If InRaster is a layer in the table of contents, a path to the data is not required, but the name must be enclosed in square brackets []. If the raster data is not in the table of contents, the path to the data on disk must be provided. For example, Int(C:\data\InRaster)
- Click Evaluate.
- Multiply input data by 100 to retain data values past the decimal point. When converting to integer, values past the decimal point are truncated. If all values are in the range 0 to 1 (for example, 0.3), and you convert to integer, all values will be 0 unless you multiply the values by 100 first. You must remember that any values then used in analysis must be divided by 100 to obtain the correct result.
|
Using the Single Output Map Algebra tool
- On the Standard toolbar, click the Show/Hide ArcToolbox button to show ArcToolbox.
- Click the Index tab.
- Type "Single Output Map Algebra (sa)" to locate the tool.
Learn more about the Single Output Map Algebra tool
- Double-click the tool in the list to open its dialog box.
Note that clicking Locate displays the location of the tool in the ArcToolbox Favorites list.
- In the Expression box, type
Int(C:\Data\InRaster)
where InRaster is your input floating-point raster, then click OK. Alternately, if InRaster is a layer in the table of contents, expand the Input raster or feature data to show in ModelBuilder (optional) subsection and drag the layer into the list. Type "Int(" then drag the layer from the list into the Expression box. Close the brackets so your expression resembles: Int(InRaster)
Type a name for the output raster and click OK.
Please visit the
Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.