#!/usr/bin/env python # coding: utf-8 # In[ ]: import ee import geemap # In[ ]: Map = geemap.Map(zoom=8) # In[ ]: image = ee.Image('LE7_TOA_5YEAR/1999_2003').select(['B1', 'B2', 'B3', 'B4', 'B5', 'B7']) # In[ ]: Map.addLayer(image, {'bands': ['B4', 'B3', 'B2'], 'min': 20, 'max': 200, 'gamma': 2.0}, 'Landsat 7') Map # In[ ]: region = Map.user_roi # In[ ]: if region is None: region = ee.Geometry.Point([-101.5, 40]).buffer(100000) Map.addLayer(ee.Image().paint(region, 0, 4), {'palette': 'yellow'}, "ROI-1") # In[ ]: random_points = geemap.random_sampling(image, region, numPixels=1000) Map.addLayer(random_points, {}, "Random Sampling") # In[ ]: df = geemap.ee_to_pandas(random_points) df # In[ ]: region2 = Map.user_roi # In[ ]: if region2 is None: region2 = ee.Geometry.Point([-99, 40]).buffer(100000) Map.addLayer(ee.Image().paint(region2, 0, 4), {'palette': 'blue'}, "ROI-2") # In[ ]: sys_points = geemap.random_sampling(image, region2, scale=10000) Map.addLayer(sys_points, {}, "Systematic Sampling") # In[ ]: df = geemap.ee_to_pandas(sys_points) df # ![](https://i.imgur.com/14ulR5D.png)