Skip to main content
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Post Reopened by Vale, PolyGeo
added 5 characters in body; edited tags; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Raster calculation with multiple rasters using ArcGIS Desktop?

I have three rasters:

Raster1: resolution 25x25, floating point. Value of "1" when it is true, value of -9999 when it is false (only this two values)

Raster2: resolution 25x25, floating point. Only integer values from 194 to 1738

Raster3: resolution 25x25, floating point. Decimal values are stored too, from -2544,81 to 941,66

  • Raster1: resolution 25x25, floating point. Value of "1" when it is true, value of -9999 when it is false (only this two values)
  • Raster2: resolution 25x25, floating point. Only integer values from 194 to 1738
  • Raster3: resolution 25x25, floating point. Decimal values are stored too, from -2544,81 to 941,66

All the rasters have the same CRS and are in TIFF format.

What I want to do is to create a fourth raster like this:

If Raster1 =1, then Raster2 (true statement), else Raster3 (false statement)

I tried this in ArcGis 10.3 Raster Calculator:

Con("Raster1" == 1,"Raster2","Raster3")

But I get this error:

Con(Raster(r"Raster1") == 1,Raster(r"Raster2"),Raster(r"Raster3"))
ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset to F:\folder\step13 with output format GRID.

Failed to execute (RasterCalculator).

I tried the same thing using Python:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "F:/folder"
Ras1 = Raster("Raster1")
Ras2 = Raster("Raster2")
Ras3 = Raster("Raster3")
outCon = Con((Ras1==1),Ras2, Ras3)
outCon.save = ("F:/folder/out")

But I get this error:

RuntimeError: ERROR 000875: Output raster: C:\xxx\xxx\Documents\ArcGIS\Default.gdb\ifthe_ras's workspace is an invalid output workspace.

I'm stuck. I cannot understand what's wrong with my raster calculations.

Raster calculation with multiple rasters

I have three rasters:

Raster1: resolution 25x25, floating point. Value of "1" when it is true, value of -9999 when it is false (only this two values)

Raster2: resolution 25x25, floating point. Only integer values from 194 to 1738

Raster3: resolution 25x25, floating point. Decimal values are stored too, from -2544,81 to 941,66

All the rasters have the same CRS and are in TIFF format.

What I want to do is to create a fourth raster like this:

If Raster1 =1, then Raster2 (true statement), else Raster3 (false statement)

I tried this in ArcGis 10.3 Raster Calculator:

Con("Raster1" == 1,"Raster2","Raster3")

But I get this error:

Con(Raster(r"Raster1") == 1,Raster(r"Raster2"),Raster(r"Raster3"))
ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset to F:\folder\step13 with output format GRID.

Failed to execute (RasterCalculator).

I tried the same thing using Python:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "F:/folder"
Ras1 = Raster("Raster1")
Ras2 = Raster("Raster2")
Ras3 = Raster("Raster3")
outCon = Con((Ras1==1),Ras2, Ras3)
outCon.save = ("F:/folder/out")

But I get this error:

RuntimeError: ERROR 000875: Output raster: C:\xxx\xxx\Documents\ArcGIS\Default.gdb\ifthe_ras's workspace is an invalid output workspace.

I'm stuck. I cannot understand what's wrong with my raster calculations.

Raster calculation with multiple rasters using ArcGIS Desktop?

I have three rasters:

  • Raster1: resolution 25x25, floating point. Value of "1" when it is true, value of -9999 when it is false (only this two values)
  • Raster2: resolution 25x25, floating point. Only integer values from 194 to 1738
  • Raster3: resolution 25x25, floating point. Decimal values are stored too, from -2544,81 to 941,66

All the rasters have the same CRS and are in TIFF format.

What I want to do is to create a fourth raster like this:

If Raster1 =1, then Raster2 (true statement), else Raster3 (false statement)

I tried this in ArcGis 10.3 Raster Calculator:

Con("Raster1" == 1,"Raster2","Raster3")

But I get this error:

Con(Raster(r"Raster1") == 1,Raster(r"Raster2"),Raster(r"Raster3"))
ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset to F:\folder\step13 with output format GRID.

Failed to execute (RasterCalculator).

I tried the same thing using Python:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "F:/folder"
Ras1 = Raster("Raster1")
Ras2 = Raster("Raster2")
Ras3 = Raster("Raster3")
outCon = Con((Ras1==1),Ras2, Ras3)
outCon.save = ("F:/folder/out")

But I get this error:

RuntimeError: ERROR 000875: Output raster: C:\xxx\xxx\Documents\ArcGIS\Default.gdb\ifthe_ras's workspace is an invalid output workspace.

I'm stuck. I cannot understand what's wrong with my raster calculations.

deleted 122 characters in body; edited tags
Source Link
Vale
  • 941
  • 7
  • 23

I have three rasters:

Raster1: resolution 25x25, floating point. Value of "1" when it is true, value of -9999 when it is false (only this two values)

Raster2: resolution 25x25, floating point. Only integer values from 194 to 1738

Raster3: resolution 25x25, floating point. Decimal values are stored too, from -2544,81 to 941,66

All the rasters have the same CRS and are in TIFF format.

What I want to do is to create a fourth raster like this:

If Raster1 =1, then Raster2 (true statement), else Raster3 (false statement)

I tried this in ArcGis 10.3 Raster Calculator:

Con("Raster1" == 1,"Raster2","Raster3")

But I get this error:

Con(Raster(r"Raster1") == 1,Raster(r"Raster2"),Raster(r"Raster3"))
ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset to F:\folder\step13 with output format GRID.

Failed to execute (RasterCalculator).

I tried the same thing using Python:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "F:/folder"
Ras1 = Raster("Raster1")
Ras2 = Raster("Raster2")
Ras3 = Raster("Raster3")
outCon = Con((Ras1==1),Ras2, Ras3)
outCon.save = ("F:/folder/out")

But I get this error:

RuntimeError: ERROR 000875: Output raster: C:\xxx\xxx\Documents\ArcGIS\Default.gdb\ifthe_ras's workspace is an invalid output workspace.

I'm stuck. I cannot understand what's wrong with the expression.

I also tried to this with QGIS 2.14 but I don't know how to write this sentence in there, since no conditional statement is presentmy raster calculations.

I have three rasters:

Raster1: resolution 25x25, floating point. Value of "1" when it is true, value of -9999 when it is false (only this two values)

Raster2: resolution 25x25, floating point. Only integer values from 194 to 1738

Raster3: resolution 25x25, floating point. Decimal values are stored too, from -2544,81 to 941,66

All the rasters have the same CRS and are in TIFF format.

What I want to do is to create a fourth raster like this:

If Raster1 =1, then Raster2 (true statement), else Raster3 (false statement)

I tried this in ArcGis 10.3 Raster Calculator:

Con("Raster1" == 1,"Raster2","Raster3")

But I get this error:

Con(Raster(r"Raster1") == 1,Raster(r"Raster2"),Raster(r"Raster3"))
ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset to F:\folder\step13 with output format GRID.

Failed to execute (RasterCalculator).

I tried the same thing using Python:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "F:/folder"
Ras1 = Raster("Raster1")
Ras2 = Raster("Raster2")
Ras3 = Raster("Raster3")
outCon = Con((Ras1==1),Ras2, Ras3)
outCon.save = ("F:/folder/out")

But I get this error:

RuntimeError: ERROR 000875: Output raster: C:\xxx\xxx\Documents\ArcGIS\Default.gdb\ifthe_ras's workspace is an invalid output workspace.

I'm stuck. I cannot understand what's wrong with the expression.

I also tried to this with QGIS 2.14 but I don't know how to write this sentence in there, since no conditional statement is present.

I have three rasters:

Raster1: resolution 25x25, floating point. Value of "1" when it is true, value of -9999 when it is false (only this two values)

Raster2: resolution 25x25, floating point. Only integer values from 194 to 1738

Raster3: resolution 25x25, floating point. Decimal values are stored too, from -2544,81 to 941,66

All the rasters have the same CRS and are in TIFF format.

What I want to do is to create a fourth raster like this:

If Raster1 =1, then Raster2 (true statement), else Raster3 (false statement)

I tried this in ArcGis 10.3 Raster Calculator:

Con("Raster1" == 1,"Raster2","Raster3")

But I get this error:

Con(Raster(r"Raster1") == 1,Raster(r"Raster2"),Raster(r"Raster3"))
ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset to F:\folder\step13 with output format GRID.

Failed to execute (RasterCalculator).

I tried the same thing using Python:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "F:/folder"
Ras1 = Raster("Raster1")
Ras2 = Raster("Raster2")
Ras3 = Raster("Raster3")
outCon = Con((Ras1==1),Ras2, Ras3)
outCon.save = ("F:/folder/out")

But I get this error:

RuntimeError: ERROR 000875: Output raster: C:\xxx\xxx\Documents\ArcGIS\Default.gdb\ifthe_ras's workspace is an invalid output workspace.

I'm stuck. I cannot understand what's wrong with my raster calculations.

Post Closed as "Needs more focus" by PolyGeo
Source Link
Vale
  • 941
  • 7
  • 23
Loading