当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python ArcGIS Feature用法及代码示例


本文简要介绍 python 语言中 arcgis.features.Feature 的用法。

用法:

class arcgis.features.Feature(geometry=None, attributes=None)

位于空间中具有一组属性的实体可以表示为特征。

# Obtain a feature from a feature layer:

# Query a Feature Layer to get a Feature Set
>>> feature_set = feature_layer.query(where="OBJECTID=1")
# Assign a variable to the list of features in the Feature Set
>>> feature_list = feature_set.features
# Get an individual feature
>>> feature = feature_list[0]

# Verify the object type
>>> type(feature)
arcgis.features.feature.Feature
# Print the string representation of the feature
>>> feature
{"geometry": {"x": -8238318.738276444, "y": 4970309.724235498, "spatialReference": {"wkid": 102100, "latestWkid": 3857}},
"attributes": {"Incident_Type": "Structural-Sidewalk Collapse", "Location": "927 Broadway", "Borough": "Manhattan",
"Creation_Date": 1477743211000, "Closed_Date": null, "Latitude": 40.7144215406227, "Longitude": -74.0060763804198,
"ObjectId": 1}}

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 arcgis.features.Feature。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。