Hello everyone, I'm having some problems with an Arcpy script that I've attached below.
It should be a simple script, it was converted from ModelBuilder so it mostly just a series of tools, although the script iterates between each feature (features = arcpy.GetParameterAsText(1)) and runs a different set of tools. The goal is to intersect all input features (mulitvalue in the toolbox settings) convert lines and polygons into points, merge all points than get a sum of how many points are in each "TWP" Polygon.
The entire script functions fine except the Spatial Join, which I commented out at one point to check the later tools. I've run the Spatial Join with the same data in both ModelBuilder and ArcMap, both are done within seconds. In Arcpy, the script will run until ArcMap crashes, closing on its own. If the Spatial Join is commented out the script will run to completion.
You can find the Spatial Join in line 127, and just above that you can see I have tried repairing the geometry, converting to feature layers, and adding spatial indices to both inputs.
Please let me know if you have any other ideas, it would be a huge help, thanks.
Ryan
Solved! Go to Solution.
Spatial join was crashing for me as well, even after trying Denis SavItskiy's suggestion. It was possible for me to use the Intersect Tool instead, since I was trying to do a simple spatial join with match_option='INTERSECT'. Maybe see if there is another tool that does the same job for you.
Hi Christina, could you please let me know which version of ArcGIS you are using? The original question was on 10.3.1.
I am also on 10.3.1