ee.FeatureCollection.getString
Extract a property from a feature.
Usage | Returns |
---|
FeatureCollection.getString(property) | String |
Argument | Type | Details |
---|
this: object | Element | The feature to extract the property from. |
property | String | The property to extract. |
Examples
// 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'));
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
# 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())
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["`getString()` extracts a string property value from a FeatureCollection."],["The method requires the FeatureCollection object and the property name as input."],["The extracted property value is returned as an ee.String object."],["Code examples demonstrate property extraction in both JavaScript and Python."]]],["The core function described is `getString(property)`, used to extract a string property from a feature. It takes two inputs: the feature itself and the name of the desired property (string). The function returns the property's value as a string. The provided examples demonstrate how to use `getString` in both JavaScript and Python to retrieve the \"string_property\" from a FeatureCollection, with the property set as 'Abies magnifica'.\n"]]