ee.FeatureCollection.bounds

  • The bounds() method calculates the bounding box of all geometries within a FeatureCollection.

  • You can optionally specify a maxError to control reprojection accuracy, and a proj to determine the projection of the resulting bounding box.

  • The resulting bounding box is returned as a Geometry object.

  • The FeatureCollection.bounds() method can be called directly on a feature collection instance to determine the area encompassed by all the included features.

Constructs a bounding box around the geometries in a collection.

UsageReturns
FeatureCollection.bounds(maxError, proj)Geometry
ArgumentTypeDetails
this: collectionFeatureCollectionThe collection whose bounds will be constructed.
maxErrorErrorMargin, optionalThe maximum amount of error tolerated when performing any necessary reprojection.
projProjection, optionalIf specified, the result will be in this projection. Otherwise it will be in EPSG:4326.

Examples

Code Editor (JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

print('Bounds of Belgium power plants:', fc.bounds());  // ee.Geometry

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)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

print('Bounds of Belgium power plants:', fc.bounds().getInfo())  # ee.Geometry