Runtime Error: Cannot Open Feature Class in Editor Session

المشرف العام

Administrator
طاقم الإدارة
I am using an update cursor in a script and need to make edits from arcpy.da.Editor. The error that is being thrown is a Runtime Error where the feature class cannot be opened.

import arcpyimport GetSRConfigimport osdef GetThisDir(): import inspect return os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))sDir = GetThisDir()sSDECon = os.path.join(sDir, GetSRConfig.SDEConnFile)sdeLayer = os.path.join(sSDECon, GetSRConfig.LN_SDEDATA)pWorksapce = (sSDECon)edit = arcpy.da.Editor(pWorksapce)edit.startEditing(False, False)srField = "NUMBERCYLA"vehNameDi = dict ([(sr, vehNam) for sr, vehName in arcpy.da.SearchCursor (GetSRConfig.LN_SDEDATA, [GetSRConfig.FN_NUMBERCYLA, GetSRConfig.FN_VehiclNam],"""VehicleNam ''""")])with arcpy.da.UpdateCursor(GetSRConfig.LN_SDEDATA, [GetSRConfig.FN_NUMBERCYLA,GetSRConfig.FN_VehiclNam],"""VehicleNam = ''""") as cursor: for sr, vehNam in cursor: if not sr in vehNameDi: continue row = (sr, vehNameDi [sr]) cursor.updateRow (row) del cursoredit.stopEditing(True)

أكثر...
 
أعلى