Serious error with working script, no clue why

289
1
07-08-2019 01:46 AM
ArtyArt
New Contributor

Hello community,

I compiled a python script (with the help of the internet) to split polygons by attribute based area percentages.

I know my script is definitely not the most elegant one, but basically it does a great job.

Big but... I am facing a problem since there will be a serious error shutting down ArcMap (tried 10.5 and 10.6 on several systems) any time I run the script. I tried to split the very big feature class in blocks of 500 features to be split. I additionally removed null geometries and fixed geometry (self intersections). Now some blocks are processed well, others not.

What else should I try to avoid/debug this annoying error?

(Sorry, the script might be way too long for a quick overview.)

Thanks in advance!

0 Kudos
1 Reply
ArtyArt
New Contributor

Adjusting some screws, I figured that the "step_value" in line 61 (crucial for the cutting/splitting operation) raises the error. Increasing the value (in meters) prevents the error from happening, but increases the deviation from the wanted area percentage.

Who knows if and how I can start with a small value to try, e.g. "0.1" and automatically increase the value if necessary? try: (...) except: (...) ?

0 Kudos