计数渲染 (空间统计)

许可等级:BasicStandardAdvanced

摘要

应用分级圆圈对要素类中的数值型字段进行渲染。

插图

Count Renderer illustration

用法

语法

CountRenderer_stats (input_feature_class, field_to_render, output_layer_file, number_of_classes, symbol_color, {maximum_field_value})
参数说明数据类型
input_feature_class

包含要渲染的计数数据的要素图层。

Feature Layer
field_to_render

包含计数数据的字段的名称。

Field
output_layer_file

包含渲染信息的新的输出图层文件。文件名中必须包含 .lyr 扩展名。

Layer File
number_of_classes

选择要将输入要素类分成多少类。

Long
symbol_color

分级圆圈的颜色。

  • 芒果黄 (MANGO)
  • 鲜红 (BRIGHT_RED)
  • 墨绿 (DARK_GREEN)
  • 绿色 (GREEN)
  • 深蓝 (DARK_BLUE)
  • 亮粉红 (BRIGHT_PINK)
  • 浅黄 (LIGHT_YELLOW)
  • 天蓝 (SKY_BLUE)
String
maximum_field_value
(可选)

要渲染的最大属性值。字段值大于此最大值的要素将不绘制。

Double

代码实例

计数渲染器 (CountRenderer) 示例 1(Python 窗口)

以下 Python 窗口脚本演示了如何使用计数渲染器 (CountRenderer) 工具。

import arcpy
arcpy.env.workspace = "c:/data"
arcpy.CountRenderer_stats("autotheft_weighted.shp", "Count", "auto_weight_rendered.lyr", "5", "mango","#")
计数渲染器 (CountRenderer) 示例 2(独立 Python 脚本)

以下独立 Python 脚本演示了如何使用计数渲染器 (CountRenderer) 工具。

# Convert incident data to weighted point data and render
 
# Import system modules
import arcpy, sys, string, os
 
# Local variables...
workspace = "C:/data"
input = "AutoTheft.shp"
input_weighted = "autotheft_weighted.shp"
results_field = "Count"
input_weighted_rendered = "auto_weight_rendered.lyr"
 
try:
    # Set the current workspace (to avoid having to specify the full path to the feature classes each time)
    arcpy.env.workspace = workspace
 
    # Process: Collect Events...
    arcpy.CollectEvents_stats(input, input_weighted, results_field)
 
    # Process: Count Rendering...
    arcpy.CountRenderer_stats(input_weighted, results_field, input_weighted_rendered, "5", "MANGO", "#")
 
except:
    # If an error occurred when running the tool, print out the error message.
    print arcpy.GetMessages()

环境

相关主题

许可信息

ArcGIS for Desktop Basic: 是
ArcGIS for Desktop Standard: 是
ArcGIS for Desktop Advanced: 是
5/10/2014