ee.FeatureCollection.get
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Extrayez une propriété d'une entité.
Utilisation | Renvoie |
---|
FeatureCollection.get(property) | |
Argument | Type | Détails |
---|
ceci : object | Élément | Fonctionnalité à partir de laquelle extraire la propriété. |
property | Chaîne | Propriété à extraire. |
Exemples
Éditeur de code (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')));
Configuration de Python
Consultez la page
Environnement Python pour en savoir plus sur l'API Python et sur l'utilisation de geemap
pour le développement interactif.
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())
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[null,null,["Dernière mise à jour le 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```"]]