ee.FeatureCollection.getInfo

Es una función imperativa que devuelve toda la información conocida sobre esta colección a través de una llamada de AJAX.

Devuelve una descripción de la colección cuyos campos incluyen lo siguiente:

  - features: Es una lista que contiene metadatos sobre los atributos de la colección.

  - properties: Es un diccionario opcional que contiene las propiedades de metadatos de la colección.

UsoMuestra
FeatureCollection.getInfo(callback)FeatureCollectionDescription
ArgumentoTipoDetalles
esta: featurecollectionFeatureCollectionInstancia de FeatureCollection.
callbackFunción, opcionalEs una devolución de llamada opcional. Si no se proporciona, la llamada se realiza de forma síncrona. Si se proporciona, se llamará con el primer parámetro si la operación se realiza correctamente y con el segundo si no se realiza correctamente.

Ejemplos

Editor de código (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);

Configuración de Python

Consulta la página Entorno de Python para obtener información sobre la API de Python y el uso de geemap para el desarrollo interactivo.

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'])