ee.FeatureCollection.serialize
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Renvoie la représentation sérialisée de cet objet.
Utilisation | Renvoie |
---|
FeatureCollection.serialize(legacy) | Chaîne |
Argument | Type | Détails |
---|
ceci : computedobject | ComputedObject | Instance ComputedObject. |
legacy | Booléen, facultatif | Active l'ancien format. |
Exemples
Éditeur de code (JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
print('Serialized representation of ee.FeatureCollection', fc.serialize());
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)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
print('Serialized representation of ee.FeatureCollection:',
fc.serialize())
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\u003e\u003ccode\u003eserialize()\u003c/code\u003e returns a string representation of a given \u003ccode\u003eFeatureCollection\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThis method can be used with an optional \u003ccode\u003elegacy\u003c/code\u003e Boolean argument to enable legacy formatting.\u003c/p\u003e\n"],["\u003cp\u003eExample code snippets are provided in JavaScript, Python, and Colab to demonstrate the usage of \u003ccode\u003eserialize()\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `serialize()` method returns a string representation of a `FeatureCollection` object. It accepts an optional boolean argument, `legacy`, to enable a legacy format. The method is demonstrated using a `FeatureCollection` of Belgian power plants, filtered by the condition `country_lg == \"Belgium\"`. The examples show how to apply this function using both JavaScript (Code Editor) and Python (Colab) to generate a serialized string output.\n"],null,["# ee.FeatureCollection.serialize\n\n\u003cbr /\u003e\n\nReturns the serialized representation of this object.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------|---------|\n| FeatureCollection.serialize`(`*legacy*`)` | String |\n\n| Argument | Type | Details |\n|------------------------|-------------------|------------------------------|\n| this: `computedobject` | ComputedObject | The ComputedObject instance. |\n| `legacy` | Boolean, optional | Enables legacy format. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// FeatureCollection of power plants in Belgium.\nvar fc = ee.FeatureCollection('WRI/GPPD/power_plants')\n .filter('country_lg == \"Belgium\"');\n\nprint('Serialized representation of ee.FeatureCollection', fc.serialize());\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# FeatureCollection of power plants in Belgium.\nfc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\n\nprint('Serialized representation of ee.FeatureCollection:',\n fc.serialize())\n```"]]