I'm trying to use ExtractByAttributes() in a PYT.
I couldn't get it to work, so I tried the GP Pane. That worked fine. So, I copy-pasted the command from GP Pane into my PYT and it still failed.
Code:
with arcpy.EnvManager(scratchWorkspace=r"\\...\Default.gdb"):
out_raster = arcpy.sa.ExtractByAttributes(
in_raster=r"\\...\Default.gdb\SurfaceDEMClip_A",
where_clause="VALUE <= 2007.11"
)
Errors:
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.ERROR 000864: Input raster: The input is not within the defined domain.ERROR 000969: The input raster is not integer type.ERROR 000864: Field: The input is not within the defined domain.ERROR 000889: Invalid field type. Failed to execute (RasterToPolygon).
Does anyone know what's going on or how to fix it? (Or an alternative?)
Solved! Go to Solution.
Update: It looks like the issue is when it's inside a SearchCursor.
Bizarre.
I'll write up a support ticket and update this when I have more information.
EDIT: Actually I was just looking at the wrong lines.
Sorry everyone.
Update: It looks like the issue is when it's inside a SearchCursor.
Bizarre.
I'll write up a support ticket and update this when I have more information.
EDIT: Actually I was just looking at the wrong lines.
Sorry everyone.