本文簡要介紹 python 語言中 arcgis.features.Feature.set_value
的用法。
用法:
set_value(field_name, value)
返回:
一個布爾值,指示
field_name
值是否已更新 (True) 或未更新 (False)。
設置給定字段名稱的屬性值。
Parameter
Description
field_name
必需的字符串。要更新的字段的名稱。
value
必需的。用於更新字段的值。
例子:
# Usage Example >>> feat_set = feature_layer.query(where="OBJECTID=1") >>> feat = feat_set.features[0] >>> feat.fields ['OBJECTID', 'FID_Commun', 'AREA', 'PERIMETER', 'NAME', 'COUNTY', 'CONAME'] >>> feat.get_value("NAME") 'Original Name' >>> feat.set_value(field_name = "NAME", value = "New Name") True
注意:
要保存對上述代碼段的編輯,請在列表中使用
edit_features()
和feat_set
作為updates
參數。
相關用法
- Python ArcGIS Feature.geometry用法及代碼示例
- Python ArcGIS Feature.attributes用法及代碼示例
- Python ArcGIS FeatureLayerCollection.extract_changes用法及代碼示例
- Python ArcGIS FeatureLayer.manager用法及代碼示例
- Python ArcGIS FeatureLayer.delete_features用法及代碼示例
- Python ArcGIS FeatureLayer.fromitem用法及代碼示例
- Python ArcGIS FeatureLayer.query_related_records用法及代碼示例
- Python ArcGIS FeatureLayer用法及代碼示例
- Python ArcGIS FeatureLayer.query_date_bins用法及代碼示例
- Python ArcGIS FeatureLayer.get_unique_values用法及代碼示例
- Python ArcGIS FeatureLayer.generate_renderer用法及代碼示例
- Python ArcGIS FeatureLayer.append用法及代碼示例
- Python ArcGIS FeatureLayer.calculate用法及代碼示例
- Python ArcGIS FeatureCollection.from_featureset用法及代碼示例
- Python ArcGIS FeatureLayer.edit_features用法及代碼示例
- Python ArcGIS Feature用法及代碼示例
- Python ArcGIS FeatureSet.save用法及代碼示例
- Python ArcGIS FeatureLayer.query用法及代碼示例
- Python ArcGIS Feed.metrics用法及代碼示例
- Python ArcGIS FeedsManager.get用法及代碼示例
- Python ArcGIS FeedsManager.create用法及代碼示例
- Python ArcGIS FeedsManager.items用法及代碼示例
- Python ArcGIS Feed.start用法及代碼示例
- Python ArcGIS Feed.stop用法及代碼示例
- Python ArcGIS Feed.status用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.features.Feature.set_value。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。