Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.FeatureCollection.get
Stay organized with collections
Save and categorize content based on your preferences.
Extract a property from a feature.
Usage | Returns | FeatureCollection.get(property) | |
Argument | Type | Details | this: object | Element | The feature to extract the property from. |
property | String | The property to extract. |
Examples
Code Editor (JavaScript)
// A global power plant FeatureCollection.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants');
// View a list of FeatureCollection property names.
print(fc.propertyNames());
// Get the value of a listed property.
print('Global power plant data provider as ee.ComputedObject',
fc.get('provider'));
// The returned value is an ee.ComputedObject which has no methods available for
// further processing; cast to the relevant Earth Engine object class for use.
print('Global power plant data provider as ee.String',
ee.String(fc.get('provider')));
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
Colab (Python)
# A global power plant FeatureCollection.
fc = ee.FeatureCollection('WRI/GPPD/power_plants')
# View a list of FeatureCollection property names.
print(fc.propertyNames().getInfo())
# Get the value of a listed property.
print('Global power plant data provider as ee.ComputedObject:',
fc.get('provider').getInfo())
# The returned value is an ee.ComputedObject which has no methods available for
# further processing; cast to the relevant Earth Engine object class for use.
print('Global power plant data provider as ee.String:',
ee.String(fc.get('provider')).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."],[[["\u003cp\u003eThe \u003ccode\u003eget()\u003c/code\u003e method is used to extract a specific property from a Feature or FeatureCollection in Earth Engine.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epropertyNames()\u003c/code\u003e method provides a list of all property names associated with a Feature or FeatureCollection.\u003c/p\u003e\n"],["\u003cp\u003eThe value returned by \u003ccode\u003eget()\u003c/code\u003e is an \u003ccode\u003eee.ComputedObject\u003c/code\u003e and might need to be cast to a specific Earth Engine object type for further processing.\u003c/p\u003e\n"],["\u003cp\u003eThe provided examples demonstrate how to access and utilize the extracted property value in both JavaScript and Python environments.\u003c/p\u003e\n"]]],["The core functionality involves extracting a specific property from a FeatureCollection using the `get(property)` method. This method requires the feature itself and the property name as input. The returned value is initially an `ee.ComputedObject`, which must be cast to the appropriate Earth Engine object type (e.g., `ee.String`) for further use. Examples demonstrate accessing property names via `propertyNames()` and extracting the 'provider' property from a power plant FeatureCollection in both JavaScript and Python.\n"],null,["# ee.FeatureCollection.get\n\nExtract a property from a feature.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------|---------|\n| FeatureCollection.get`(property)` | |\n\n| Argument | Type | Details |\n|----------------|---------|-------------------------------------------|\n| this: `object` | Element | The feature to extract the property from. |\n| `property` | String | The property to extract. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A global power plant FeatureCollection.\nvar fc = ee.FeatureCollection('WRI/GPPD/power_plants');\n\n// View a list of FeatureCollection property names.\nprint(fc.propertyNames());\n\n// Get the value of a listed property.\nprint('Global power plant data provider as ee.ComputedObject',\n fc.get('provider'));\n\n// The returned value is an ee.ComputedObject which has no methods available for\n// further processing; cast to the relevant Earth Engine object class for use.\nprint('Global power plant data provider as ee.String',\n ee.String(fc.get('provider')));\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# A global power plant FeatureCollection.\nfc = ee.FeatureCollection('WRI/GPPD/power_plants')\n\n# View a list of FeatureCollection property names.\nprint(fc.propertyNames().getInfo())\n\n# Get the value of a listed property.\nprint('Global power plant data provider as ee.ComputedObject:',\n fc.get('provider').getInfo())\n\n# The returned value is an ee.ComputedObject which has no methods available for\n# further processing; cast to the relevant Earth Engine object class for use.\nprint('Global power plant data provider as ee.String:',\n ee.String(fc.get('provider')).getInfo())\n```"]]