Skip to main content
added 315 characters in body
Source Link
Michael Stimson
  • 25.7k
  • 2
  • 35
  • 75

As you have reclassified this raster I'll assume that you have access to the Spatial Analyst extension, so will continue with instructions that require this extension.

The tool you want to use is Con, although you can do it with Extract by Attributes Con gives you more control over the 'false' case. Your SQL statement has the potential to be quite long unless you've got a suitable range for example:

Value > 350 && Value < 360 || Value = 340

Like this:

enter image description here

Note that the input conditional raster and input true raster or constant are the same value.. this is saying where the expression is true the output will be what's in the input; the false raster or constant is 0... so where the expression is true the output will be the input, where it's false it will be 0.

For individual values (for example 3,5,7,9) you can specify implicitly:

Value == 3 || Value == 5 || Value == 7 || Value == 9

Which can get quite long winded, however for Integer rasters (not floating point) like classified rasters you can use the SQL in operator:

Value in (3,5,7,9)

Which is significantly less typing and you don't need to search all over your keyboard for the pipe (|) symbol to do a C style OR.

As you have reclassified this raster I'll assume that you have access to the Spatial Analyst extension, so will continue with instructions that require this extension.

The tool you want to use is Con, although you can do it with Extract by Attributes Con gives you more control over the 'false' case. Your SQL statement has the potential to be quite long unless you've got a suitable range for example:

Value > 350 && Value < 360 || Value = 340

Like this:

enter image description here

For individual values (for example 3,5,7,9) you can specify implicitly:

Value == 3 || Value == 5 || Value == 7 || Value == 9

Which can get quite long winded, however for Integer rasters (not floating point) like classified rasters you can use the SQL in operator:

Value in (3,5,7,9)

Which is significantly less typing and you don't need to search all over your keyboard for the pipe (|) symbol to do a C style OR.

As you have reclassified this raster I'll assume that you have access to the Spatial Analyst extension, so will continue with instructions that require this extension.

The tool you want to use is Con, although you can do it with Extract by Attributes Con gives you more control over the 'false' case. Your SQL statement has the potential to be quite long unless you've got a suitable range for example:

Value > 350 && Value < 360 || Value = 340

Like this:

enter image description here

Note that the input conditional raster and input true raster or constant are the same value.. this is saying where the expression is true the output will be what's in the input; the false raster or constant is 0... so where the expression is true the output will be the input, where it's false it will be 0.

For individual values (for example 3,5,7,9) you can specify implicitly:

Value == 3 || Value == 5 || Value == 7 || Value == 9

Which can get quite long winded, however for Integer rasters (not floating point) like classified rasters you can use the SQL in operator:

Value in (3,5,7,9)

Which is significantly less typing and you don't need to search all over your keyboard for the pipe (|) symbol to do a C style OR.

Source Link
Michael Stimson
  • 25.7k
  • 2
  • 35
  • 75

As you have reclassified this raster I'll assume that you have access to the Spatial Analyst extension, so will continue with instructions that require this extension.

The tool you want to use is Con, although you can do it with Extract by Attributes Con gives you more control over the 'false' case. Your SQL statement has the potential to be quite long unless you've got a suitable range for example:

Value > 350 && Value < 360 || Value = 340

Like this:

enter image description here

For individual values (for example 3,5,7,9) you can specify implicitly:

Value == 3 || Value == 5 || Value == 7 || Value == 9

Which can get quite long winded, however for Integer rasters (not floating point) like classified rasters you can use the SQL in operator:

Value in (3,5,7,9)

Which is significantly less typing and you don't need to search all over your keyboard for the pipe (|) symbol to do a C style OR.