ArcGIS for Desktop

  • 文档
  • 合约
  • 支持

  • My Profile
  • 帮助
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

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

ArcGIS for Desktop

全面的专业性 GIS

ArcGIS for Server

面向企业的 GIS

ArcGIS for Developers

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

ArcGIS Solutions

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

ArcGIS Marketplace

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

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

帮助

  • 主页
  • 入门
  • 制图
  • 分析
  • 管理数据
  • 工具
  • 更多...

Schema

  • 摘要
  • 讨论
  • 属性
  • 代码实例

摘要

数据集的 schema。

讨论

类型为要素类、表、栅格或工作空间的每个输出参数都具有 schema 对象。

属性

属性说明数据类型
additionalChildren
(读写)

Python list of datasets to add to a workspace schema.

String
additionalFields
(读写)

Indicates additional fields for the fields property. Besides the fields that are added by the application of the fieldsRule, you can add additional fields to the output.

Field
cellSize
(读写)

Set this to the cell size to use when cellSizeRule is AsSpecified.

Double
cellSizeRule
(读写)

Determines the cell size of output rasters or grids.

  • AsSpecified —The output cell size is specified in the cellSize property.
  • FirstDependency —The cell size is calculated from the first dependent parameter. If the dependent parameter is a raster, then its cell size is used. For other types of dependent parameters, such as feature classes or feature datasets, the extent of the data is used to calculate a cell size. If the first dependent parameter is a multivalue (a list of values), the first value in the multivalue list is used.
  • Max —The largest cell size of the dependent parameters.
  • Min —The smallest cell size of the dependent parameters.
  • Environment —The cell size is calculated based on the cell size environment setting.
String
clone
(读写)

If True, make an exact copy (clone) of the description in the first dependent parameter. The default value is False.

Boolean
extent
(读写)

Set this to the extent to use when extentRule is AsSpecified. You can either set the extent with a space-delimited string or a Python list object with four values. The sequence is xmin, ymin, xmax, ymax.

Extent
extentRule
(读写)

Indicates how the extent property is to be managed.

  • AsSpecified —The output extent will be specified in the Extent property.
  • FirstDependency —The output extent is the same as the first dependent parameter. If the first dependent parameter is a multivalue (a list of values), the first value in the multivalue list is used.
  • Intersection —The output extent will be the geometric intersection of all dependent parameters.
  • Union —The output extent will be the geometric union of all dependent parameters.
  • Environment —The output extent will be calculated based on the output extent environment setting.
String
featureType
(读写)

When the featureTypeRule is AsSpecified, the value in FeatureType is used to specify the feature type of the output.

  • Simple —The output will contain simple features. The geometry type of the features is specified with geometryTypeRule.
  • Annotation —The output will contain annotation features.
  • Dimension —The output will contain dimension features.
String
featureTypeRule
(读写)

This setting determines the feature type of the output feature class. This rule has no effect on output rasters or tables.

  • AsSpecified —The feature type will be determined by the featureType property.
  • FirstDependency —The feature type will be the same as the first parameter in the dependencies. If the first dependent parameter is a multivalue (a list of values), the first value in the multivalue list is used.
String
fieldsRule
(读写)

Determines what fields will exist on the output feature class or table.

  • None —No fields will be output except for the object ID.
  • FirstDependency —Output fields will be the same as the first dependent parameter. If the first dependent parameter is a multivalue (a list of values), the first value in the multivalue list is used.
  • FirstDependencyFIDs —Only the ObjectID of the first dependent input will be written to the output.
  • All —All fields in the list of dependent parameters will be output.
  • AllNoFIDs —All fields except for the ObjectIDs will be written to the output.
  • AllFIDsOnly —All ObjectID fields are written to the output, but no other fields from the inputs will be written.
String
geometryType
(读写)

Set this to the geometry type to use (either Point, Multipoint, Polyline, or Polygon) when geometryTypeRule is AsSpecified.

String
geometryTypeRule
(读写)

This setting determines the geometry type (such as point or polygon) of the output feature class.

  • Unknown —This is the default setting. Typically, you should be able to determine the geometry type in updateParameters() based on the values of other parameters. You'd only set the rule to Unknown if you don't have enough information to determine the geometry type, such as in initializeParameters().
  • FirstDependency —The geometry type is the same as the first dependent parameter. If the first dependent parameter is a multivalue (a list of values), the first value in the multivalue list is used.
  • Max —Examines the geometries of all dependent parameters and sets the output geometry type to the maximum type found.
  • Min —Examines the geometries of all dependent parameters and sets the output geometry type to the minimum type found.
  • AsSpecified —The geometry type will be determined by the value of the geometryType property.
String
rasterFormatRule
(读写)

This determines the output raster format, either GRID or Img. The default is Img, which is ERDAS IMAGINE format.

String
rasterRule
(读写)

This determines the data type—integer or float—contained in the output raster.

  • FirstDependency —The data type (integer or float) is the same as the first dependent parameter. If the first dependent parameter is a multivalue (a list of values), the first value in the multivalue list is used.
  • Max —If there are dependant parameters that include integers and floats, Max creates a float output.
  • Min —If there are dependant parameters that include integers and floats, Min creates an integer output.
  • Integer —The output raster contains integers.
  • Float —The output raster contains floats.
String
type
(只读)

The schema type: Feature, Table, Raster, or Container (for workspaces and feature datasets).

String

代码实例

ToolValidator 类中的 Schema 示例

将输出参数的 schema 设置为第一个输入参数。

def initializeParameters(self):
    # Set the dependencies for the output and its schema properties
    #  The two input parameters are feature classes.
    self.params[2].parameterDependencies = [0, 1]

    # Feature type, geometry type, and fields all come from the first
    #  dependency (parameter 0), the input features
    self.params[2].schema.featureTypeRule = "FirstDependency"
    self.params[2].schema.geometryTypeRule = "FirstDependency"
    self.params[2].schema.fieldsRule = "FirstDependency"

    # The extent of the output is the intersection of the input features
    #  and the clip features (parameter 1)
    self.params[2].schema.extentRule = "Intersection"

    return
ToolValidator 类中的 Schema 示例

查询特定工具参数的方案

import arcpy

toolname = "Buffer_analysis"
parameter = 1

# Get the schema of the tool parameter
schema = arcpy.GetParameterInfo(toolname)[parameter].schema

properties = ['additionalChildren', 'additionalFields', 'cellSize',
              'cellSizeRule', 'clone', 'extent', 'extentRule',
              'featureType', 'featureTypeRule', 'fieldsRule',
              'geometryType', 'geometryTypeRule', 'rasterFormatRule',
              'rasterRule', 'type']

# Walk through all schema property and print out the value
for property in properties:
    try:
        print("{0} : {1}".format(property, eval("schema." + property)))
    except NameError:
        print property

相关主题

  • 设置脚本工具参数
  • Value
  • Filter
  • Parameter
  • 自定义脚本工具行为
有关此主题的反馈?

ArcGIS for Desktop

  • 主页
  • 文档
  • 合约
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • 内部人员博客
  • 用户大会
  • 开发者峰会
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | 隐私政策 | 法律声明