Skip to content

Commit

Permalink
Update clustering sample to use a Collection 2 Landsat composite
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 658834152
  • Loading branch information
jdbcode authored and copybara-github committed Aug 2, 2024
1 parent 7e8ffd7 commit f07834c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
11 changes: 7 additions & 4 deletions samples/javascript/guides/clustering.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
*/

// [START earthengine__clustering__clustering]
// Load a pre-computed Landsat composite for input.
var input = ee.Image('LANDSAT/LE7_TOA_1YEAR/2001');

// Define a region in which to generate a sample of the input.
// Define a region in which to generate a segmented map.
var region = ee.Geometry.Rectangle(29.7, 30, 32.5, 31.7);

// Load a Landsat composite for input.
var input = ee.ImageCollection('LANDSAT/COMPOSITES/C02/T1_L2_32DAY')
.filterDate('2001-05', '2001-06')
.first()
.clip(region);

// Display the sample region.
Map.setCenter(31.5, 31.0, 8);
Map.addLayer(ee.Image().paint(region, 0, 2), {}, 'region');
Expand Down
13 changes: 9 additions & 4 deletions samples/python/guides/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@
# from 'Unsupervised Classification' section.

# [START earthengine__clustering__clustering]
# Load a pre-computed Landsat composite for input.
input = ee.Image('LANDSAT/LE7_TOA_1YEAR/2001')

# Define a region in which to generate a sample of the input.
# Define a region in which to generate a segmented map.
region = ee.Geometry.Rectangle(29.7, 30, 32.5, 31.7)

# Load a Landsat composite for input.
input = (
ee.ImageCollection('LANDSAT/COMPOSITES/C02/T1_L2_32DAY')
.filterDate('2001-05', '2001-06')
.first()
.clip(region)
)

# Display the sample region.
m = geemap.Map()
m.set_center(31.5, 31.0, 8)
Expand Down

0 comments on commit f07834c

Please sign in to comment.