简体   繁体   English

在ArcGIS中制作栅格属性表的问题

[英]Problem making attribute table of raster in ArcGIS

I have a python script that makes an attribute table of a raster. 我有一个python脚本,它创建一个栅格的属性表。 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, 在前3个栅格中,我收到一条警告信息,

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. 谢谢。

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. 对于网格,如果栅格中的值范围小于100,000或栅格中的唯一值数小于500,则默认情况下会为表达式生成的任何整数网格构建栅格属性表。如果范围小于100,000,栅格中唯一值的数量可以大到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. 如果范围大于100,000,如果唯一值的数量小于500,仍将构建栅格属性表。如果值的范围大于100,000且唯一值的数量大于500,则栅格属性表将生成属性表不是自动构建的。 By default, the size of a raster attribute table is limited to 65,535 unique values. 默认情况下,栅格属性表的大小限制为65,535个唯一值。 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. 我只是重新阅读了栅格文档,并且可以手动增加允许使用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. 我会把它留在这里一两天看看。

The warning: 警告:

Value range for c:\\raster2 exceeds 100000 and number of unique values exceeds 500. Please use BUILDVAT if a VAT is required. c:\\ raster2的值范围超过100000,唯一值的数量超过500.如果需要增值税,请使用BUILDVAT。

...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. 但是,在我的情况下,我使用arcpy.PolygonToRaster_conversion将多边形要素类转换为栅格。 This is where warning 010367 is generated. 这是生成警告010367的地方。 If you subsequently use arcpy.BuildRasterAttributeTable_management on the raster, then you can just ignore the above warning. 如果随后在栅格上使用arcpy.BuildRasterAttributeTable_management,则可以忽略上述警告。

Without seeing additional content from your script, I can't address your second error. 如果没有看到脚本中的其他内容,我无法解决您的第二个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM