ee.FeatureCollection.getInfo

Fonction impérative qui renvoie toutes les informations connues sur cette collection via un appel AJAX.

Renvoie une description de la collection dont les champs incluent les éléments suivants :

- features : liste contenant des métadonnées sur les éléments de la collection.

- properties : dictionnaire facultatif contenant les propriétés de métadonnées de la collection.

UtilisationRenvoie
FeatureCollection.getInfo(callback)FeatureCollectionDescription|Object
ArgumentTypeDétails
this: featurecollectionFeatureCollectionInstance FeatureCollection.
callbackFonction, facultativeRappel facultatif. S'il n'est pas fourni, l'appel est effectué de manière synchrone. S'il est fourni, il est appelé avec le premier paramètre en cas de réussite et le second en cas d'échec.

Exemples

Éditeur de code (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);

Configuration de Python

Pour en savoir plus sur l'API Python et sur l'utilisation de geemap pour le développement interactif, consultez la page Environnement Python.

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()
display('Client-side feature collection is a dictionary:', type(fc_client))
display('Feature collection dictionary keys:', fc_client.keys())
display('Array of features:', fc_client['features'])
display('Properties of first feature:', fc_client['features'][0]['properties'])