0

I have a raster dataset [Flow Accumulation Raster]. Which is located in gdb. I need to perform Con Tool operation with this raster dataset. The Con Tool operation runs successfully with this dataset in ArcGIS 10.1,10.2,10.3 and 10.4 but it does not work in 10.5.

To perform Con Tool these steps I followed in Python window of ArcGIS:
FlowAccumulationRaster is available in TOC.

>>> import sys
>>> import arcpy
>>> from arcpy import env
>>> from arcpy.sa import *
>>> env.workspace = "C:\StreamCreationTes.gdb"
>>> env.scratchWorkspace = "C:\StreamCreationTes.gdb"
>>> spFactoryCode = int(32628)
>>> arcpy.CheckOutExtension("Spatial")
    u'CheckedOut'
>>> spRef = arcpy.SpatialReference()
>>> spRef.factoryCode = spFactoryCode
>>> spRef.create()
>>> arcpy.env.outputCoordinateSystem =  spRef
>>> outConditional = Con("FlowAccumulationRaster","FlowAccumulationRaster, 
    "", "VALUE > 10000")

I got this error message.

error Message: Runtime error Traceback (most recent call last):
File "", line 1, in File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\sa\Functions.py", line 263, in Con where_clause) File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\sa\Utils.py", line 53, in swapper result = wrapper(*args, *kwargs) File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\sa\Functions.py", line 257, in Wrapper where_clause) File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\geoprocessing_base.py", line 510, in return lambda args: val(*gp_fixargs(args, True)) ExecuteError: ERROR 001143: Background server threw an exception.

This is the Geoprocessing Options settings of my ArcGIS. Geoprocessing Options

Can anyone help in this regard?

6
  • 1
    Can you please edit your question to include a screenshot of the Con tool and the specific error you're getting?
    – Fezter
    Commented Apr 19, 2018 at 6:08
  • 1
    have you tried running your tool in foreground ?
    – radouxju
    Commented Apr 19, 2018 at 6:43
  • 1
    Please always provide code and any error messages as text rather than pictures.
    – PolyGeo
    Commented Apr 19, 2018 at 7:12
  • Your first picture says "SteamCreationTest.gdb" the second one says "StreamCreationTes.gdb"
    – RJJoling
    Commented Apr 19, 2018 at 8:32
  • I'm just pointing it out so you can double check whether these are both valid pathnames for these geodatabases. And that both geodatabases contain the raster.
    – RJJoling
    Commented Apr 19, 2018 at 13:46

1 Answer 1

1

It's possible that the issue is due to the Background Geoprocessing.

You can disable background processing from the geoprocessing menu, Geoprocessing Options...

enter image description here

Then untick the enable box.

enter image description here

Run your code again.

4
  • I had tried but still did not work.
    – osman
    Commented Apr 19, 2018 at 6:37
  • 2
    Do you get the same error?
    – Fezter
    Commented Apr 19, 2018 at 6:39
  • hmm................................
    – osman
    Commented Apr 19, 2018 at 6:39
  • When possible I avoid using fgdb for raster calculation. Try that, it might surprise you.
    – FelixIP
    Commented Apr 19, 2018 at 20:06

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.