當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。