I am trying to select layer by attribute and for that, I am using arcpy.SelectLayerByAttribute_management function . My command is as follows:
arcpy.SelectLayerByAttribute_management(union, 'NEW_SELECTION', '"gridcode" =1 AND "area" >=25000000*0.4')
Here, union is the shapefile, from which I need to select layers by attribute. My SQL query is "gridcode" =1 AND "area" >=25000000*0.4
I am getting the following error:
ExecuteError: Failed to execute. Parameters are not valid. The value cannot be a feature class ERROR 000840: The value is not a Raster Layer. ERROR 000840: The value is not a Mosaic Layer. Failed to execute (SelectLayerByAttribute).`
"area" >= 10000000? – Vince Mar 13 '19 at 11:34unionis appears to be the problem. It's not a layer that the tool wants. – KHibma Mar 13 '19 at 12:22