F12g Checkpoint
Import libraries¶
In [ ]:
Copied!
import ee
import geemap
import ee
import geemap
Create an interactive map¶
In [ ]:
Copied!
Map = geemap.Map(center=[40, -100], zoom=4)
Map = geemap.Map(center=[40, -100], zoom=4)
Add Earth Engine Python script¶
In [ ]:
Copied!
# Add Earth Engine dataset
image = ee.Image("USGS/SRTMGL1_003")
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Chapter: F1.2 Survey of Raster Datasets
# Checkpoint: F12g
# Authors: Andréa, Karen, Nick Clinton, David Saah
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##/
# Other datasets
##/
# Import and filter a gridded population dataset.
griddedPopulation = ee.ImageCollection("CIESIN/GPWv411/GPW_Population_Count").first()
# Predefined palette.
populationPalette = ["ffffe7", "86a192", "509791", "307296", "2c4484", "000066"]
# Center the Map.
Map.centerObject(griddedPopulation, 3)
# Add the population data to the map.
Map.addLayer(
griddedPopulation,
{"min": 0, "max": 1200, "palette": populationPalette},
"Gridded Population",
)
# Import the NASA DEM Dataset.
nasaDEM = ee.Image("NASA/NASADEM_HGT/001")
# Add the elevation layer to the map.
Map.addLayer(nasaDEM, {"bands": ["elevation"], "min": 0, "max": 3000}, "NASA DEM")
# -----------------------------------------------------------------------
# CHECKPOINT
# -----------------------------------------------------------------------
# Add Earth Engine dataset
image = ee.Image("USGS/SRTMGL1_003")
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Chapter: F1.2 Survey of Raster Datasets
# Checkpoint: F12g
# Authors: Andréa, Karen, Nick Clinton, David Saah
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##/
# Other datasets
##/
# Import and filter a gridded population dataset.
griddedPopulation = ee.ImageCollection("CIESIN/GPWv411/GPW_Population_Count").first()
# Predefined palette.
populationPalette = ["ffffe7", "86a192", "509791", "307296", "2c4484", "000066"]
# Center the Map.
Map.centerObject(griddedPopulation, 3)
# Add the population data to the map.
Map.addLayer(
griddedPopulation,
{"min": 0, "max": 1200, "palette": populationPalette},
"Gridded Population",
)
# Import the NASA DEM Dataset.
nasaDEM = ee.Image("NASA/NASADEM_HGT/001")
# Add the elevation layer to the map.
Map.addLayer(nasaDEM, {"bands": ["elevation"], "min": 0, "max": 3000}, "NASA DEM")
# -----------------------------------------------------------------------
# CHECKPOINT
# -----------------------------------------------------------------------
Display the interactive map¶
In [ ]:
Copied!
Map
Map