ee.Geometry.BBox.geometries
Returns the list of geometries in a GeometryCollection, or a singleton list of the geometry for single geometries.
Usage | Returns |
---|
BBox.geometries() | List |
Argument | Type | Details |
---|
this: geometry | Geometry | |
Examples
// Define a BBox object.
var bBox = ee.Geometry.BBox(-122.09, 37.42, -122.08, 37.43);
// Apply the geometries method to the BBox object.
var bBoxGeometries = bBox.geometries();
// Print the result to the console.
print('bBox.geometries(...) =', bBoxGeometries);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(bBox,
{'color': 'black'},
'Geometry [black]: bBox');
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
# Define a BBox object.
bbox = ee.Geometry.BBox(-122.09, 37.42, -122.08, 37.43)
# Apply the geometries method to the BBox object.
bbox_geometries = bbox.geometries()
# Print the result.
display('bbox.geometries(...) =', bbox_geometries)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(bbox, {'color': 'black'}, 'Geometry [black]: bbox')
m
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["The `geometries()` method returns a list of geometries within a GeometryCollection or a single geometry if applied to individual geometries."],["This method is applicable to `Geometry` objects, such as `BBox`, and provides access to their underlying geometric components."],["The output is a `List` containing the extracted geometries."],["Usage examples are provided in JavaScript and Python, illustrating how to retrieve and utilize the geometries of a bounding box."]]],["The `geometries()` method retrieves a list of geometries from a `GeometryCollection` or returns a single-element list for individual geometries. It is invoked on a `Geometry` object, such as a `BBox`. The function returns a List. In the examples, a `BBox` is defined, and the `geometries()` method is used to obtain its geometries which are printed. The resulting geometry is displayed on a map. Both JavaScript and Python (with Colab) examples are provided.\n"]]