# 计算 Z 值 (地统计分析)

## 用法

• 此工具通常仅用于模型或脚本中，因为 ArcMap 识别工具也可用来计算单个位置的预测值。

## 语法

GACalculateZValue_ga (in_geostat_layer, point_coord)
 参数 说明 数据类型 in_geostat_layer 要分析的地统计图层。 Geostatistical Layer point_coord 需要计算 Z 值点的 x,y 坐标。 Point

## 代码实例

GACalculateZValue（Python 窗口）

``````import arcpy
arcpy.env.workspace = "C:/gapyexamples/data"
outCZV = arcpy.GACalculateZValue_ga("C:/gapyexamples/data/Kriging.lyr",
"-2000000 -50000")
print outCZV
``````
GACalculateZValue（独立脚本）

``````# Name: CalculateZValue_Example_02.py
# Description: Uses the interpolation model in a geostatistical
#              layer to predict a value at a single location.
# Requirements: Geostatistical Analyst Extension

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "C:/gapyexamples/data"

# Set local variables
inGALayer = "C:/gapyexamples/data/Kriging.lyr"
pointCoord = "-2000000 -50000"

# Check out the ArcGIS Geostatistical Analyst extension license
arcpy.CheckOutExtension("GeoStats")

# Execute CalculateZValue
outCZV = arcpy.GACalculateZValue_ga(inGALayer, pointCoord)

# Print results
print outCZV
``````

## 许可信息

ArcGIS for Desktop Basic: 需要 Geostatistical Analyst
ArcGIS for Desktop Standard: 需要 Geostatistical Analyst
ArcGIS for Desktop Advanced: 需要 Geostatistical Analyst
5/10/2014