ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Calculate Areas

  • 描述
  • 插图
  • 使用方法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

Calculates area values for each feature in a polygon feature class.

旧版本:

Because there are easier and more efficient ways to get the area of features, the Calculate Areas tool has been deprecated. Use the Calculate Field tool or the Geometry Calculator instead of the Calculate Areas tool in your workflows and custom script or models tools. If you are using feature classes in a geodatabase, the shape_area attribute field is maintained for you automatically.

插图

Calculate Areas illustration

使用方法

  • The F_AREA field created in the Output Feature Class will be populated with values for the area of each polygon feature in square units of the Output Coordinate System.

  • There are alternative methods for creating an Area field for polygon features including: Calculate Field and the Geometry Calculator.

  • The Output Feature Class is a copy of the Input Feature Class with the additional (or updated) F_AREA field containing polygon areas.

  • 警告:

    The F_AREA field is created in the Output Feature Class to store calculated Area values. If a field of this name already exists in the Input Feature Class, it will be overwritten in the Output Feature Class.

    警告:

    在使用 shapefile 时,请注意 shapefile 无法存储空值。根据非 shapefile 输入创建 shapefile 的工具或其他过程可能会将空值存储(或解释)为零。某些情况下,空值则以极大的负值储存于 shapefile 中。这会产生意外的结果。有关详细信息,请参阅 shapefile 输出的地理处理注意事项。

语法

arcpy.stats.CalculateAreas(Input_Feature_Class, Output_Feature_Class)
参数说明数据类型
Input_Feature_Class

The input polygon feature class.

Feature Layer
Output_Feature_Class

The output feature class. This feature class is a copy of the input feature class with field F_AREA added (or updated). The F_AREA field contains the polygon area.

Feature Class

代码示例

CalculateAreas Example (Python Window)

The following Python Window script demonstrates how to use the CalculateAreas tool.

import arcpy
arcpy.env.workspace = "c:/data"
arcpy.CalculateAreas_stats("tracts.shp", "tracts_with_area_field.shp")
CalculateAreas Example (stand-alone Python script)

The following stand-alone Python script demonstrates how to use the CalculateAreas tool.

# Calculate AREA values
 
# Import system modules
import arcpy
 
# Local variables...
workspace = "C:/data"
input = "tracts.shp"
calculate_output = "tracts_with_area_field.shp"
 
try:
    # Set the current workspace (to avoid having to specify the full path to the feature classes each time)
    arcpy.env.workspace = workspace
 
    # Process: Calculate Areas...
    arcpy.CalculateAreas_stats(input, calculate_output)
 
except:
    # If an error occurred when running the tool, print out the error message.
    print arcpy.GetMessages()

环境

  • 输出坐标系
    注:

    Feature geometry is projected to the Output Coordinate System prior to analysis.

  • 当前工作空间
  • 临时工作空间
  • 限定的字段名
  • 输出包含 M 值
  • 输出包含 Z 值
  • 默认输出 Z 值

许可信息

  • Basic: 是
  • Standard: 是
  • Advanced: 是

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明