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?

  • 1
    Can you please edit your question to include a screenshot of the Con tool and the specific error you're getting? – Fezter Apr 19 '18 at 6:08
  • 1
    have you tried running your tool in foreground ? – radouxju Apr 19 '18 at 6:43
  • 1
    Please always provide code and any error messages as text rather than pictures. – PolyGeo Apr 19 '18 at 7:12
  • Your first picture says "SteamCreationTest.gdb" the second one says "StreamCreationTes.gdb" – RJJoling Apr 19 '18 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 Apr 19 '18 at 13:46
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.

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

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.