ee.FeatureCollection.filter

Aplique um filtro a esta coleção.

Retorna a coleção filtrada.

UsoRetorna
FeatureCollection.filter(filter)Coleção
ArgumentoTipoDetalhes
isso: collectionColeçãoA instância da coleção.
filterFiltroUm filtro a ser aplicado a esta coleção.

Exemplos

Editor de código (JavaScript)

// Load a collection of counties.
var counties = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2');

// Filter the collection to get Denver county.
var denverCollection = counties.filter(ee.Filter.eq('ADM2_NAME', 'Denver'));

// Or you can use a string filter (equivalent to the above):
// var denverCollection = counties.filter("ADM2_NAME == 'Denver'");

Map.centerObject(denverCollection, 9);
Map.addLayer(denverCollection, null, 'Denver');

Configuração do Python

Consulte a página Ambiente Python para informações sobre a API Python e como usar geemap para desenvolvimento interativo.

import ee
import geemap.core as geemap

Colab (Python)

# Load a collection of counties.
counties = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2')

# Filter the collection to get Denver county.
denver_collection = counties.filter(ee.Filter.eq('ADM2_NAME', 'Denver'))

# Or you can use a string filter (equivalent to the above):
# denver_collection = counties.filter("ADM2_NAME == 'Denver'")

m = geemap.Map()
m.center_object(denver_collection, 9)
m.add_layer(denver_collection, None, 'Denver')
m