Select to view content in your preferred language

Zonal Geometry and Zonal Geometry as Table crashing in Python window and Python standalone script

65
1
yesterday
IanParfitt1
New Member

I'm attempting to use Zonal Geometry to identify narrow polygons using ArcGIS Pro 3.6.1.  I've tried both Zonal Geometry and Zonal Geometry as a Table.

1.  Zonal Geometry. The Zonal Geometry tool works in a minute or so in the desktop app and creates an output raster in my geodatabase with an uncompressed size of 577.76 MB (19629 columns x 7716 rows, 32 Bit floating point), but I'm not having joy with using Python.  The Python window in the app attempts to run, and I can see that *.tif files are created in the temp directory.  However, the function seems to spin on so I have ended after 60 minutes or so.  When I try to run as a standalone script I receive ERROR 000354: The name contains invalid characters. However, I don't see any name errors.

I want to run this for many jurisdictions identified by a string variable "jc", so I create a variable for the input grid (inGrid = "tmp" + jc ) which is a 0.2m resolution raster created from a feature class to raster conversion.  The class field is a long integer field (zoneField =  "PID_int") , the geometry metric is 'THICKNESS' and the cell size is 0.2m.  I also create a variable for the output (zgGrid = "zonegeo" + jc)

so the function looks like this:

zgresult= ZonalGeometry(inGrid, zoneField, 'THICKNESS', 0.2)

zgresult.save(zgGrid)

I have also tried making a raster layer first:

try:
        arcpy.management.MakeRasterLayer(inGrid, "out_rasterlayer")
        zgresult = ZonalGeometry("out_rasterlayer", zoneField, 'THICKNESS', 0.2)
        zgresult.save(zgGrid)
 
Same result: ERROR 000354: The name contains invalid characters
 
2.  Zonal Geometry as a Table.  When I run this function in a python window it also fails, but with a different error: ERROR 010067: Error in executing grid expression. create hash:
 
processingCellSize = 0.2
outgeoTab = "outgeoTab_" + jc
 
outZonalGeometryAsTable = ZonalGeometryAsTable(outGrid, zoneField, outgeoTab, processsingCellSize)
 

I am running on a reasonably well resourced laptop with plenty of storage space. I'm using VSCode as an IDE and have the correct python interpreter for this version or ArcGIS Pro / arcpy.

 

I use env.workspace to set the workspace to my geodatabase for this project.

I also use env.extent  and env.mask = inGrid in order to limit the processing as much as possible.

 

Thanks in advance for any ideas.

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

000354: The name contains invalid characters.—ArcGIS Pro | Documentation

invalid characters can include a period or a space, check your workspace path, perhaps copying the *.tif files to it and setting it as your temp or workspace folder (eg c:/testfolder is a good short simple path for inputs and outputs)


... sort of retired...
0 Kudos