Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.FeatureCollection.getInfo
Stay organized with collections
Save and categorize content based on your preferences.
An imperative function that returns all the known information about this collection via an AJAX call.
Returns a collection description whose fields include:
- features: a list containing metadata about the features in the collection.
- properties: an optional dictionary containing the collection's metadata properties.
Usage | Returns | FeatureCollection.getInfo(callback) | FeatureCollectionDescription |
Argument | Type | Details | this: featurecollection | FeatureCollection | The FeatureCollection instance. |
callback | Function, optional | An optional callback. If not supplied, the call is made synchronously. If supplied, will be called with the first parameter if successful and the second if unsuccessful. |
Examples
Code Editor (JavaScript)
/**
* WARNING: this function transfers data from Earth Engine servers to the
* client. Doing so can negatively affect request processing and client
* performance. Server-side options should be used whenever possible.
* Learn more about the distinction between server and client:
* https://developers.google.com/earth-engine/guides/client_server
*/
// A server-side ee.FeatureCollection of power plants in Belgium.
var fcServer = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Use getInfo to transfer server-side feature collection to the client. The
// result is an object.
var fcClient = fcServer.getInfo();
print('Client-side feature collection is an object', typeof fcClient);
print('Feature collection object keys', Object.keys(fcClient));
print('Array of features', fcClient.features);
print('Properties of first feature', fcClient.features[0].properties);
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)
"""WARNING: this function transfers data from Earth Engine servers to the
client. Doing so can negatively affect request processing and client
performance. Server-side options should be used whenever possible.
Learn more about the distinction between server and client:
https://developers.google.com/earth-engine/guides/client_server
"""
# A server-side ee.FeatureCollection of power plants in Belgium.
fc_server = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
# Use getInfo to transfer server-side feature collection to the client. The
# result is an object.
fc_client = fc_server.getInfo()
print('Client-side feature collection is a dictionary:', type(fc_client))
print('Feature collection dictionary keys:', fc_client.keys())
print('Array of features:', fc_client['features'])
print('Properties of first feature:', fc_client['features'][0]['properties'])
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\u003e\u003ccode\u003egetInfo()\u003c/code\u003e retrieves all data from a server-side FeatureCollection to the client as a FeatureCollectionDescription.\u003c/p\u003e\n"],["\u003cp\u003eThe returned FeatureCollectionDescription contains 'features' (metadata about features) and optional 'properties' (collection metadata).\u003c/p\u003e\n"],["\u003cp\u003eThis function can negatively impact performance due to client-side data transfer; server-side alternatives are preferred when feasible.\u003c/p\u003e\n"],["\u003cp\u003eUsage involves calling \u003ccode\u003eFeatureCollection.getInfo()\u003c/code\u003e with an optional callback function for asynchronous execution.\u003c/p\u003e\n"]]],[],null,["# ee.FeatureCollection.getInfo\n\n\u003cbr /\u003e\n\nAn imperative function that returns all the known information about this collection via an AJAX call.\n\n\u003cbr /\u003e\n\nReturns a collection description whose fields include:\n\n- features: a list containing metadata about the features in the collection.\n\n- properties: an optional dictionary containing the collection's metadata properties.\n\n| Usage | Returns |\n|-------------------------------------------|------------------------------|\n| FeatureCollection.getInfo`(`*callback*`)` | FeatureCollectionDescription |\n\n| Argument | Type | Details |\n|---------------------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `featurecollection` | FeatureCollection | The FeatureCollection instance. |\n| `callback` | Function, optional | An optional callback. If not supplied, the call is made synchronously. If supplied, will be called with the first parameter if successful and the second if unsuccessful. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n/**\n * WARNING: this function transfers data from Earth Engine servers to the\n * client. Doing so can negatively affect request processing and client\n * performance. Server-side options should be used whenever possible.\n * Learn more about the distinction between server and client:\n * https://developers.google.com/earth-engine/guides/client_server\n */\n\n// A server-side ee.FeatureCollection of power plants in Belgium.\nvar fcServer = ee.FeatureCollection('WRI/GPPD/power_plants')\n .filter('country_lg == \"Belgium\"');\n\n// Use getInfo to transfer server-side feature collection to the client. The\n// result is an object.\nvar fcClient = fcServer.getInfo();\nprint('Client-side feature collection is an object', typeof fcClient);\nprint('Feature collection object keys', Object.keys(fcClient));\nprint('Array of features', fcClient.features);\nprint('Properties of first feature', fcClient.features[0].properties);\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\"\"\"WARNING: this function transfers data from Earth Engine servers to the\nclient. Doing so can negatively affect request processing and client\nperformance. Server-side options should be used whenever possible.\nLearn more about the distinction between server and client:\nhttps://developers.google.com/earth-engine/guides/client_server\n\"\"\"\n\n# A server-side ee.FeatureCollection of power plants in Belgium.\nfc_server = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\n\n# Use getInfo to transfer server-side feature collection to the client. The\n# result is an object.\nfc_client = fc_server.getInfo()\nprint('Client-side feature collection is a dictionary:', type(fc_client))\nprint('Feature collection dictionary keys:', fc_client.keys())\nprint('Array of features:', fc_client['features'])\nprint('Properties of first feature:', fc_client['features'][0]['properties'])\n```"]]