ArcGIS Raster Calculator Use Con to Replace High Values – Syntax Generator


ArcGIS Raster Calculator Syntax Generator

Expert logic to use Con to replace high values in spatial analysis


The exact name of the layer in your Contents pane.


Values greater than this will be replaced.
Please enter a valid number.


The new value assigned to pixels exceeding the threshold.


Action taken for pixels that do not exceed the limit.

Generated Expression

Con(“Elevation_DEM” > 2500, 2500, “Elevation_DEM”)
Logical Test
Value > 2500
Condition Met (True)
Set to 2500
Condition Unmet (False)
Original Value

Logic Description: This ArcGIS Map Algebra statement evaluates every pixel in the raster. If the pixel’s value is greater than the threshold, it assigns the replacement value; otherwise, it assigns the specified fallback value.

Visualizing arcgis raster calculator use con to replace high values

Simulation of pixel value clipping (Input vs. Output)

Chart Caption: The blue line represents original data trends; the green line shows how high values are capped/replaced by the Con function.

What is arcgis raster calculator use con to replace high values?

The arcgis raster calculator use con to replace high values technique is a fundamental procedure in GIS spatial analysis used to clean, normalize, or constrain data within a raster dataset. The Con function—short for Conditional—allows users to perform an “if-else” logical operation across millions of pixels simultaneously.

GIS professionals use this when data contains outliers, sensor errors, or when a specific analysis requires a ceiling on values. For example, in flood modeling, an analyst might use the arcgis raster calculator use con to replace high values to cap elevation heights that are geographically impossible or represent man-made structures they wish to exclude from a natural terrain model.

A common misconception is that Con only works for binary 0 and 1 outputs. In reality, the arcgis raster calculator use con to replace high values can return complex floating-point numbers, other raster datasets, or even null values (NoData), making it one of the most versatile tools in the Spatial Analyst toolbox.

arcgis raster calculator use con to replace high values Formula and Mathematical Explanation

The mathematical logic behind the arcgis raster calculator use con to replace high values follows a standard conditional structure derived from Boolean algebra. The function evaluates a conditional statement for every individual cell in the grid.

Variable Meaning in Con Function Unit Typical Range
Input Raster The source dataset being evaluated Pixel Value Varies (Integer/Float)
Conditional Statement The logical test (e.g., > 100) Boolean True / False
True Value Value if condition is met User Defined Any numeric or NoData
False Value Value if condition is not met User Defined Any numeric or Original

The formula can be expressed as: Output_Raster = Con(Condition, Value_if_True, Value_if_False). When focusing specifically on arcgis raster calculator use con to replace high values, the “Condition” is typically Raster > Threshold.

Practical Examples (Real-World Use Cases)

Example 1: Capping Terrain Slope for Development

An urban planner needs to identify land suitable for construction. Slopes higher than 15% are deemed too steep. To simplify the model, they decide to use arcgis raster calculator use con to replace high values by setting all slopes above 15 to a constant value of 15.

  • Input: Slope_Raster
  • Threshold: 15
  • Replacement: 15
  • Expression: Con("Slope_Raster" > 15, 15, "Slope_Raster")

Example 2: Removing Satellite Sensor Noise

A remote sensing scientist notices “salt and pepper” noise in a thermal band where pixels occasionally jump to 5000 (Kelvin scale), which is physically impossible. They use arcgis raster calculator use con to replace high values to set these anomalies to NoData.

  • Input: Thermal_Band
  • Threshold: 400
  • Replacement: SetNull (embedded logic) or a specific constant.
  • Expression: Con("Thermal_Band" > 400, 0, "Thermal_Band")

How to Use This arcgis raster calculator use con to replace high values Calculator

Follow these simple steps to generate your Map Algebra syntax accurately:

  1. Enter Raster Name: Type the name of your layer exactly as it appears in ArcGIS Pro or ArcMap.
  2. Define Threshold: Enter the numeric value that defines what a “high value” is in your specific context.
  3. Select Replacement: Input the value that pixels should take if they exceed your threshold.
  4. Choose Fallback: Decide if lower values should remain unchanged or be reset to zero.
  5. Copy & Paste: Use the “Copy Results” button and paste the generated string directly into the Raster Calculator tool in ArcGIS.

Key Factors That Affect arcgis raster calculator use con to replace high values Results

  • Data Type Compatibility: Ensure your replacement value matches the data type (Integer vs. Float) of your original raster to avoid unintended rounding or data loss.
  • Spatial Analyst License: Using the arcgis raster calculator use con to replace high values requires an active Spatial Analyst or Image Analyst extension.
  • NoData Handling: By default, if an input pixel is NoData, the Con function will return NoData regardless of the condition.
  • Expression Syntax: ArcGIS Pro requires double quotes for layer names "RasterName", while older versions or standalone Python might vary.
  • Nested Conditions: You can use multiple arcgis raster calculator use con to replace high values statements nested inside one another for complex range clipping.
  • Memory Management: For extremely large rasters, ensure your Scratch Workspace has enough space to store the temporary outputs created during calculation.

Frequently Asked Questions (FAQ)

1. Can I use arcgis raster calculator use con to replace high values with multiple thresholds?

Yes, you can nest Con statements: Con("raster" > 100, 100, Con("raster" < 0, 0, "raster")). This effectively caps both high and low values.

2. Why does my result only show 0 and 1?

This usually happens if you forgot the third argument in the Con function. If you only provide the condition and the true value, ArcGIS assumes the false value is NoData or 0 depending on the environment.

3. Is the arcgis raster calculator use con to replace high values case sensitive?

The Con function itself is not usually case-sensitive in the calculator, but layer names in quotes must match your table of contents exactly.

4. Can I replace high values with the mean of the raster?

Yes, but you must first calculate the mean and enter that number manually into the replacement value field in the arcgis raster calculator use con to replace high values expression.

5. What is the difference between Con and SetNull?

SetNull is a specialized version of Con that specifically replaces values with NoData. Con is more flexible as it allows any replacement value.

6. Does this work on multi-band imagery?

The Raster Calculator typically works on single bands. To apply arcgis raster calculator use con to replace high values to an RGB image, you must process each band individually.

7. Can I use "and" / "or" logic?

Absolutely. You can use operators like & and | within the condition: Con(("Raster" > 100) & ("Raster2" < 50), 99, "Raster").

8. Why is my output raster pixelated after using Con?

The arcgis raster calculator use con to replace high values does not change the resolution. If it looks pixelated, ensure your "Cell Size" environment setting is matched to your source data.

© 2023 GIS Analysis Tools - Expert Resources for Spatial Data.


Leave a Reply

Your email address will not be published. Required fields are marked *