#!/usr/bin/env python # coding: utf-8 # Open in Colab # # Uncomment the following line to install [geemap](https://geemap.org) if needed. # In[ ]: # !pip install geemap # In[ ]: import ee import geemap # In[ ]: geemap.show_youtube('N7rK2aV1R4c') # In[ ]: Map = geemap.Map() Map # In[ ]: # Add Earth Engine dataset image = ee.Image('USGS/SRTMGL1_003') # Set visualization parameters. vis_params = { 'min': 0, 'max': 4000, 'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']} # Add Earth Engine DEM to map Map.addLayer(image, vis_params, 'SRTM DEM') states = ee.FeatureCollection("TIGER/2018/States") Map.addLayer(states, {}, 'US States') # In[ ]: Map.draw_features # In[ ]: Map.draw_last_feature # In[ ]: roi = ee.FeatureCollection(Map.draw_features) selected_states = states.filterBounds(roi) Map.addLayer(selected_states, {}, "Selected states") # In[ ]: clipped_image = image.clip(selected_states) Map.addLayer(clipped_image, vis_params, 'Clipped image')