I've created a sub-model in ArcGIS, which stretches my raster data to new values.

The strange thing is, that the model works, if I run it itself - as soon as I implement it in the main model, I get this error message:

ERROR 000539: Error running expression: rcexec() Traceback (most recent call last): File "", line 1, in File "", line 5, in rcexec File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Functions.py", line 244, in Con where_clause) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Utils.py", line 47, in swapper result = wrapper(*args, **kwargs) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Functions.py", line 238, in Wrapper where_clause) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing_base.py", line 498, in return lambda *args: val(*gp_fixargs(args, True)) RuntimeError: ERROR 010240: Could not save raster dataset to C:\Users\Mattias\Documents\01_UNI\Diplomarbeit\GIS\DATA\data_out\scratch_IV.gdb\plus_ras with output format FGDBR. Failed to execute (Raster Calculator).

In my opinion, there's nothing wrong with my syntax - else it would not work in the sub-model directly...

Anyway, my map algebra expression is:

Con("%to_be_stretched%","%min_r_raster%",Con("%to_be_stretched%","%max_r_raster%",((("%to_be_stretched%" * 1.0) - "%min_in_raster%") / ("%max_in_raster%" - "%min_in_raster%")) * ("%max_r_raster%" - "%min_r_raster%") + "%min_r_raster%","VALUE >= %max_in%"),"VALUE <= %min_in%")


2 Answers 2


I"m guessing the issue is the temp workspace.

Check that the file geodatabase "C:\Users\Mattias\Documents\01_UNI\Diplomarbeit\GIS\DATA\data_out\scratch_IV.gdb\plus_ras" exists.


I get this same error when I try to write the raster calculator output to a network path that is too long and/or contains an odd character. When I write the output to my C: drive it works okay. The specific errors are the references to line 1, line, 8 and "could not save".

One solution is to write it to your C drive and then export it to the place that you want from ArcMap. (ArcGIS Desktop 10.7). Took me a while to figure this one out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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