ee.FeatureCollection.getString

Trích xuất một thuộc tính từ một đối tượng.

Cách sử dụngGiá trị trả về
FeatureCollection.getString(property)Chuỗi
Đối sốLoạiThông tin chi tiết
this: objectPhần tửTính năng để trích xuất thuộc tính.
propertyChuỗiThuộc tính cần trích xuất.

Ví dụ

Trình soạn thảo mã (JavaScript)

// A FeatureCollection with a string property value.
var fc = ee.FeatureCollection([]).set('string_property', 'Abies magnifica');

// Fetch the string property value as an ee.String object.
print('String property value as ee.String', fc.getString('string_property'));

Thiết lập Python

Hãy xem trang Môi trường Python để biết thông tin về API Python và cách sử dụng geemap cho quá trình phát triển tương tác.

import ee
import geemap.core as geemap

Colab (Python)

# A FeatureCollection with a string property value.
fc = ee.FeatureCollection([]).set('string_property', 'Abies magnifica')

# Fetch the string property value as an ee.String object.
print('String property value as ee.String:',
      fc.getString('string_property').getInfo())