ee.FeatureCollection.get
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wyodrębnij właściwość z obiektu.
Wykorzystanie | Zwroty |
---|
FeatureCollection.get(property) | |
Argument | Typ | Szczegóły |
---|
to: object | Element | Obiekt, z którego ma zostać wyodrębniona właściwość. |
property | Ciąg znaków | Właściwość do wyodrębnienia. |
Przykłady
Edytor kodu (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')));
Konfiguracja Pythona
Informacje o interfejsie Python API i używaniu geemap
do interaktywnego programowania znajdziesz na stronie
Środowisko Python.
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())
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 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```"]]