Error:  ZeroDivisionError: integer division or modulo by zero (when using the Create Cell Site Features tool)

相关信息
Article ID: 41528
Software:
ArcGIS for Local Government 10.2
Platforms: N/A

错误信息
ArcGIS for Local Government's Target Hazard Analysis tool 'Create Cell Site Features' returns the following error if there are 10 or fewer cell sites:

"ZeroDivisionError: integer division or modulo by zero"

错误原因
If there are 10 or fewer cell sites in the spreadsheet, the progress bar cannot be incremented correctly.
已邀请:

易智瑞技术支持

赞同来自:

解决方案
Modify the logic that builds the progress bar by adding the following two lines of code to the Python script:



if increment == 0:
increment = 1




In the context of the surrounding lines of code this will look like the following:
# For each tower, create antennas and sectors within the radius.
cnt = arcpy.management.GetCount(cell_towers)
increment = int(int(cnt[0]) / 10.0)
if increment == 0:
increment = 1
arcpy.SetProgressor("Step", "Creating Cell site features...", 0, int(cnt[0]), increment)



创建及修改时间
Created: 8/19/2013

Last Modified: 10/11/2013
原文链接
http://support.esri.com/en/kno ... 41528

要回复问题请先登录注册