ee.FeatureCollection.filterBounds

Es un acceso directo para filtrar una colección por intersección con la geometría. Se excluirán los elementos de la colección con una huella que no se interseca con la geometría determinada.

Esto equivale a this.filter(ee.Filter.bounds(...)).

Devuelve la colección filtrada.

UsoMuestra
FeatureCollection.filterBounds(geometry)Colección
ArgumentoTipoDetalles
esta: collectionColecciónInstancia de Collection.
geometryComputedObject|FeatureCollection|GeometryEs la geometría, la entidad o la colección con la que se realizará la intersección.

Ejemplos

Editor de código (JavaScript)

// FeatureCollection of global power plants.
var powerPlants = ee.FeatureCollection('WRI/GPPD/power_plants');

// FeatureCollection of counties in Oregon, USA.
var oregonCounties = ee.FeatureCollection('TIGER/2018/States')
                         .filter('STATEFP == "41"');

// Filter global power plants to those that intersect Oregon counties.
var oregonPowerPlants = powerPlants.filterBounds(oregonCounties.geometry());

// Display Oregon power plants on the map.
Map.setCenter(-120.492, 44.109, 6);
Map.addLayer(oregonPowerPlants);

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)

# FeatureCollection of global power plants.
power_plants = ee.FeatureCollection('WRI/GPPD/power_plants')

# FeatureCollection of counties in Oregon, USA.
oregon_counties = ee.FeatureCollection('TIGER/2018/States').filter(
    'STATEFP == "41"'
)

# Filter global power plants to those that intersect Oregon counties.
oregon_power_plants = power_plants.filterBounds(oregon_counties.geometry())

# Display Oregon power plants on the map.
m = geemap.Map()
m.set_center(-120.492, 44.109, 6)
m.add_layer(oregon_power_plants)
m