0

I am trying to extract stream raster from a flow accumulation raster using Conditional Tool in Spatial Analyst.

Here's my input:

  1. Input Raster: FLOWACC.tif
  2. Expression: Value >= 3.5
  3. True Raster: 1
  4. Output raster: Stream.tif

Error gives me invalid expression. Basically my objective is to isolate all values >=3.5 and consider them as stream raster.

I am using ArcGIS 10.2 for Desktop.

  • the expression should be : "Value" >=3.5, not Value >=3.5 – radouxju Sep 5 '14 at 11:28
2

In the raster calculator you must use this:

stream = con([FLOWACC] > 3.5, 1)
1

try this from the python window

#import arcpy

arcpy.env.workspace = #path to workspace
input_raster = #path to input raster
r = arcpy.Raster(input_raster)
output_raster = #path to output raster
temp_r = arcpy.sa.Con(r>=3.5,1)
temp_r.save(output_raster) 

Refer to the Con Tool documentation for more information.

  • Con is unnecessary: the result of the comparison r>=3.5 is already what is needed. In some applications, SetNull needs to be applied to the negation of the criterion so that cells which do not meet it are replaced with NoData--but Con is still superfluous. – whuber Sep 5 '14 at 19:48
-3

You might have to convert your raster to integer first using the raster calculator:

Formula:

int(raster*10)

Then query with value >= 35

  • 2
    Could you please describe the purpose of int(raster*10)? – Aaron Sep 4 '14 at 3:57
  • 1
    Times 10 doesn't help here – FelixIP Sep 4 '14 at 5:40
  • It seems that using SQL icon interface, instead of typing into expression box might help – FelixIP Sep 4 '14 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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