05 drawing tools
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install geemap
# !pip install geemap
In [ ]:
Copied!
import ee
import geemap
import ee
import geemap
In [ ]:
Copied!
geemap.show_youtube("N7rK2aV1R4c")
geemap.show_youtube("N7rK2aV1R4c")
In [ ]:
Copied!
Map = geemap.Map()
Map
Map = geemap.Map()
Map
In [ ]:
Copied!
# 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")
# 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 [ ]:
Copied!
Map.draw_features
Map.draw_features
In [ ]:
Copied!
Map.draw_last_feature
Map.draw_last_feature
In [ ]:
Copied!
roi = ee.FeatureCollection(Map.draw_features)
selected_states = states.filterBounds(roi)
Map.addLayer(selected_states, {}, "Selected states")
roi = ee.FeatureCollection(Map.draw_features)
selected_states = states.filterBounds(roi)
Map.addLayer(selected_states, {}, "Selected states")
In [ ]:
Copied!
clipped_image = image.clip(selected_states)
Map.addLayer(clipped_image, vis_params, "Clipped image")
clipped_image = image.clip(selected_states)
Map.addLayer(clipped_image, vis_params, "Clipped image")