python - ArcGIS中栅格属性表制作问题

标签 python scripting arcgis

我有一个 python 脚本,可以制作栅格的属性表。这遍历我拥有的所有浮点栅格,将它们转换为整数,然后制作一个属性表。

在前 3 个栅格上,我收到一条警告消息,

Value range for c:\raster2 exceeds 100000 and number of unique values exceeds 500.
Please use BUILDVAT if a VAT is required.

但是生成了一个属性表。在此之后,程序崩溃了,我不知道如何修复它。这是打印到屏幕上的错误消息:

Value range for c:\raster2 exceeds 100000 and number of unique values exceeds 500.
Please use BUILDVAT if a VAT is required.
Traceback (most recent call last):
  File "LEED_raster_attribute.py", line 50, in <module>
    make_attribute( 20, 'C:\\Analysis\\Raster_Distances\\city' )
  File "Raster_attribute.py", line 40, in make_attribute
    gp.BuildRasterAttributeTable_management(outRaster)
arcgisscripting.ExecuteError: ERROR 000521: The number of unique values exceeds the limit.
Failed to execute (BuildRasterAttributeTable).

谷歌搜索错误消息无济于事,帮助文件也无济于事。这个问题有解决办法吗?

谢谢。

最佳答案

对于网格,如果栅格中值的范围小于 100,000 或栅格中唯一值的数量小于小于 500。如果范围小于 100,000,则栅格中唯一值的数量可能高达 100,000。如果取值范围大于100000,唯一值个数小于500,仍然会建立栅格属性表。如果取值范围大于100000,唯一值个数大于500,则栅格属性表不会自动构建属性表。 默认情况下,栅格属性表的大小限制为 65,535 个唯一值。您可以通过单击栅格选项卡上的栅格属性表选项卡在选项对话框中增加此数字。

我刚刚重新阅读了光栅文档,可以手动增加允许使用 GUI 构建属性表的值。我手动输入了一个巨大的值,我的脚本成功了。


不确定这个问题/答案是否有用。我会把它留在这里一两天看看。

关于python - ArcGIS中栅格属性表制作问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3687037/

相关文章:

python - pandas 中涉及两列的聚合

python - 如何使用 Scrapy 和 PyInstaller 在 Windows 10 中创建单个可执行文件?

python - 如何在反向传播前直接设置一层的梯度?

arcgis - 使用 ArcGIS Javascript API 将 WFS 图层从 Geoserver 加载到 webmap

python - 按另一个数组的列对一个数组进行排序 - Python

python - Python 命令行脚本中 'script' 与 'entry_point' 的优缺点

Shell 脚本 - 将子字符串保存到变量

linux - 为什么 SunOS 说它不能执行这个 KornShell 脚本?

javascript - AngularJS + ArcGIS

python - 使用 CalculateField 更新带有日期的字段