Select to view content in your preferred language

Calling arcpy.analysis.SumamrizeWithin() multiple times

47
1
7 hours ago
BenMoir
New Member

New to the forum. I want to use arcpy.analysis.SumamrizeWithin() in a for loop to determine which polygons a certain polyine is contained within. I will repeat for each polyline in the feature class "shp". "street10m" is a polygon file.

I have found that arcpy.analysis.SumamrizeWithin() fails on every SECOND attempt within a code. The first time works fine. here is my sample script: 

 

print(10)
arcpy.conversion.FeatureClassToFeatureClass(shp,gdb,"zshp1","OBJECTID = 10")
print(11)
arcpy.conversion.FeatureClassToFeatureClass(shp,gdb,"zshp2","OBJECTID = 11")
print(12)
arcpy.conversion.FeatureClassToFeatureClass(shp,gdb,"zshp3","OBJECTID = 12")
print(13)
arcpy.analysis.SummarizeWithin("street10m","zshp1","z1")
print(14)
arcpy.analysis.SummarizeWithin("street10m","zshp1","z2")
print(15)
arcpy.analysis.SummarizeWithin("street10m","zshp1","z3")
print(16)

 

As written, the line to make "z2" will fail, even though its equivalent to the line which makes "z1". However, if I comment out the line which makes "z1", then "z2" is made successfully and "z3" fails. Error code 100014. If I create z1,z2,z3 manually as a batch, it also succeeds.

What is causing this behaviour? How can I allow SummarizeWithin() to be used more than once in the same arcpy script?

ArcGIS Pro 3.3 and ArcPy 3.11.8.

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

There is this article on the support site

Error: 100014: Summarize within Failed

and this error, amongst several

BUG-000172797 for ArcGIS Pro

and this post which I replied to

Arcpy Summarize Within fails after one iteration w... - Esri Community

which suggests that file locking may be at issue, but the post wasn't resolved

So perhaps check your paths, pre-process your inputs and try again after a restart


... sort of retired...
0 Kudos