Select to view content in your preferred language

ExtractByAttributes() breaks in PYT, even when copied from GP Pane?

91
1
Jump to solution
Thursday
AlfredBaldenweck
MVP Regular Contributor

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?)

0 Kudos
1 Solution

Accepted Solutions
AlfredBaldenweck
MVP Regular Contributor

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.

View solution in original post

0 Kudos
1 Reply
AlfredBaldenweck
MVP Regular Contributor

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.

0 Kudos