ArcGIS中栅格属性表制作问题

发布于 2024-09-19 12:05:22 字数 922 浏览 4 评论 0原文

我有一个 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).

谷歌搜索错误消息没有帮助,帮助文件也没有帮助。这个问题有什么解决办法吗?

谢谢。

I have a python script that makes an attribute table of a raster. This runs through all the rasters that I have which are floats, converts them to ints, then makes an attribute table.

On the first 3 rasters, I get a warning message,

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

but an attribute table is generated. After this, however the program crashes and I don't know how to fix it. This is the error message printed to screen:

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).

Googling the error message does not help, nor do the help files. Are there any solutions to this problem?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

完美的未来在梦里 2024-09-26 12:05:23

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

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


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

For grids, a raster attribute table is built by default for any integer grid that results from an expression if the range of values in the raster is less than 100,000 or if the number of unique values in the raster is less than 500. If the range is less than 100,000, the number of unique values in the raster can be as large as 100,000. If the range is greater than 100,000, a raster attribute table will still be built if the number of unique values is less than 500. If the range of values is greater than 100,000 and the number of unique values is greater than 500, then a raster attribute table is not automatically built.
By default, the size of a raster attribute table is limited to 65,535 unique values. You can increase this number on the Options dialog box by clicking the Raster Attribute Table tab on the Raster tab.

I just re-read the raster documentation, and it is possible to manually increase the value that allows attribute tables to be constructed using the GUI. I manually entered a huge value and my script worked.


Not certain if this question/answer is useful. I'll leave it here for a day or two and see.

北斗星光 2024-09-26 12:05:23

警告:

c:\raster2 的值范围超过 100000 并且唯一值的数量
超过 500。如果需要增值税,请使用 BUILDVAT。

...是在强制创建属性表之前的步骤中生成的。由于缺乏上下文,我无法针对您的具体案例进一步澄清;但是,在我的情况下,我使用 arcpy.PolygonToRaster_conversion 将面要素类转换为栅格。这是生成警告 010367 的位置。如果您随后在栅格上使用 arcpy.BuildRasterAttributeTable_management,则可以忽略上述警告。

如果没有看到脚本中的其他内容,我无法解决您的第二个错误。

The warning:

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

...is generated in the step prior to your forced creation of the attribute table. Due to the lack of context, I can't clarify that further for your specific case; however, in my situation, I covert a polygon feature class to a raster, using arcpy.PolygonToRaster_conversion. This is where warning 010367 is generated. If you subsequently use arcpy.BuildRasterAttributeTable_management on the raster, then you can just ignore the above warning.

Without seeing additional content from your script, I can't address your second error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文