Its strange that the script would start and work on some data, but then fails more than half way through. Here is the error message and relevant script (error line 229 in bold)
line 229, Select_and_Calc(CoverQuery,CoverType,CoverCode,FRST_Code)Error Info: : ERROR 000358: Invalid expressionFailed to execute (SelectLayerByAttribute).
أكثر...
line 229, Select_and_Calc(CoverQuery,CoverType,CoverCode,FRST_Code)Error Info: : ERROR 000358: Invalid expressionFailed to execute (SelectLayerByAttribute).
Define the Select and Calc function def Select_and_Calc(Query, Type, Code, ReClassCode): arcpy.SelectLayerByAttribute_management("inLayer","NEW_SELECTION",Query) CountSel = arcpy.GetCount_management("inLayer").getOutput(0) arcpy.AddMessage("\t"+str(CountSel)+"\t("+str(Code)+")\t"+\ string.upper(Type)) if int(CountSel) > 0: arcpy.CalculateField_management("inLayer","COVER",'"'+Type+'"') arcpy.CalculateField_management("inLayer","CT",Code) arcpy.CalculateField_management("inLayer","REG_CT",ReClassCode) CounterExpression = '[COUNTER] + 1' arcpy.CalculateField_management("inLayer","COUNTER",CounterExpression)
...........
ROCK******************************************************************************************* CoverType = "rock" CoverCode = "28" FRST_Code = "31" CoverQuery = '"NON_FRST" = 30 AND "NON_FRST_SPP_OS" = 0 AND "NON_FRST_TCC" = 0' Select_and_Calc(CoverQuery,CoverType,CoverCode,FRST_Code)
Thanks for any help on this
أكثر...