摘要
对某一区域的 z 得分应用从冷色(蓝色)到暖色(红色)的渲染方案。
插图

用法
语法
ZRenderer_stats (input_feature_class, field_to_render, output_layer_file)
参数 | 说明 | 数据类型 |
input_feature_class | 包含一个具有标准化 z 得分的字段的要素类。 | Feature Layer |
field_to_render | 包含 z 得分的字段的名称。 | Field |
output_layer_file | 用于存储渲染信息的新的输出图层文件。文件名中必须包括 .lyr 扩展名。 | Layer File |
代码示例
Z 得分渲染示例(Python 窗口)
下面的 Python 窗口脚本演示了如何使用 Z 得分渲染工具。
import arcpy
arcpy.env.workspace = r"C:\data"
arcpy.ZRenderer_stats("hotspot_output.shp", "GiInvDst", "hotspot_output_rendered.lyr")
Z 得分渲染示例(独立 Python 脚本)
下面的独立 Python 脚本演示了如何使用 Z 得分渲染工具。
# Perform Hot Spot Analysis for assault incidents
# Import system modules
import arcpy
# Local variables...
workspace = r"C:\data"
input = "assaults.shp"
collect_output = "collect_output.shp"
collect_count_field = "Count"
hotspot_output = "hotspot_output.shp"
hotspot_output_rendered = "hotspot_output_rendered.lyr"
z_score_field_name = "GiInvDst"
try:
# Set the current workspace (to avoid having to specify the full path to the feature classes each time)
arcpy.env.workspace = workspace
# Convert assault incidents into weighted point data
# Process: Collect Events...
arcpy.CollectEvents_stats(input, collect_output)
# Calculate Getis-Ord Gi* statistic
# Process: Hot Spot Analysis (Getis-Ord Gi*)...
arcpy.HotSpots_stats(collect_output, collect_count_field, hotspot_output, "INVERSE_DISTANCE", "EUCLIDEAN_DISTANCE", "NONE", "#", "#", "#")
# Render hot spot analysis
# Process: ZScore Rendering...
arcpy.ZRenderer_stats(hotspot_output, z_score_field_name, hotspot_output_rendered)
except:
# If an error occurred when running the tool, print out the error message.
print arcpy.GetMessages(2)
环境
许可信息
- ArcGIS Desktop Basic: 是
- ArcGIS Desktop Standard: 是
- ArcGIS Desktop Advanced: 是