Skip to content

Commit

Permalink
Update map variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Mar 17, 2024
1 parent 7dd6941 commit 1a44ea4
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
54 changes: 27 additions & 27 deletions docs/workshops/Alaska_2024_Part2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"\n",
"dem = ee.Image(\"USGS/SRTMGL1_003\")\n",
"landsat7 = ee.Image(\"LANDSAT/LE7_TOA_5YEAR/1999_2003\")\n",
Expand All @@ -311,13 +311,13 @@
" \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n",
"}\n",
"\n",
"Map.addLayer(\n",
"m.add_layer(\n",
" landsat7,\n",
" {\"bands\": [\"B4\", \"B3\", \"B2\"], \"min\": 20, \"max\": 200, \"gamma\": 2},\n",
" \"Landsat 7\",\n",
")\n",
"Map.addLayer(dem, vis_params, \"SRTM DEM\", True, 1)\n",
"Map"
"m.add_layer(dem, vis_params, \"SRTM DEM\", True, 1)\n",
"m"
]
},
{
Expand All @@ -340,7 +340,7 @@
"outputs": [],
"source": [
"in_fc = geemap.shp_to_ee(in_shp)\n",
"Map.addLayer(in_fc, {}, \"Cities\")"
"m.add_layer(in_fc, {}, \"Cities\")"
]
},
{
Expand Down Expand Up @@ -398,17 +398,17 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"Map.add_basemap(\"TERRAIN\")\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"m.add_basemap(\"TERRAIN\")\n",
"\n",
"image = ee.Image(\"USGS/SRTMGL1_003\")\n",
"vis_params = {\n",
" \"min\": 0,\n",
" \"max\": 4000,\n",
" \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n",
"}\n",
"Map.addLayer(image, vis_params, \"SRTM DEM\", True, 0.5)\n",
"Map"
"m.add_layer(image, vis_params, \"SRTM DEM\", True, 0.5)\n",
"m"
]
},
{
Expand All @@ -418,13 +418,13 @@
"metadata": {},
"outputs": [],
"source": [
"line = Map.user_roi\n",
"line = m.user_roi\n",
"if line is None:\n",
" line = ee.Geometry.LineString(\n",
" [[-120.2232, 36.3148], [-118.9269, 36.7121], [-117.2022, 36.7562]]\n",
" )\n",
" Map.addLayer(line, {}, \"ROI\")\n",
"Map.centerObject(line)"
" m.add_layer(line, {}, \"ROI\")\n",
"m.centerObject(line)"
]
},
{
Expand Down Expand Up @@ -486,7 +486,7 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"\n",
"# Add NASA SRTM\n",
"dem = ee.Image(\"USGS/SRTMGL1_003\")\n",
Expand All @@ -495,18 +495,18 @@
" \"max\": 4000,\n",
" \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n",
"}\n",
"Map.addLayer(dem, dem_vis, \"SRTM DEM\")\n",
"m.add_layer(dem, dem_vis, \"SRTM DEM\")\n",
"\n",
"# Add 5-year Landsat TOA composite\n",
"landsat = ee.Image(\"LANDSAT/LE7_TOA_5YEAR/1999_2003\")\n",
"landsat_vis = {\"bands\": [\"B4\", \"B3\", \"B2\"], \"gamma\": 1.4}\n",
"Map.addLayer(landsat, landsat_vis, \"Landsat\", False)\n",
"m.add_layer(landsat, landsat_vis, \"Landsat\", False)\n",
"\n",
"# Add US Census States\n",
"states = ee.FeatureCollection(\"TIGER/2018/States\")\n",
"style = {\"fillColor\": \"00000000\"}\n",
"Map.addLayer(states.style(**style), {}, \"US States\")\n",
"Map"
"m.add_layer(states.style(**style), {}, \"US States\")\n",
"m"
]
},
{
Expand Down Expand Up @@ -555,21 +555,21 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"\n",
"# Add NLCD data\n",
"dataset = ee.Image(\"USGS/NLCD_RELEASES/2019_REL/NLCD/2019\")\n",
"landcover = dataset.select(\"landcover\")\n",
"Map.addLayer(landcover, {}, \"NLCD 2019\")\n",
"m.add_layer(landcover, {}, \"NLCD 2019\")\n",
"\n",
"# Add US census states\n",
"states = ee.FeatureCollection(\"TIGER/2018/States\")\n",
"style = {\"fillColor\": \"00000000\"}\n",
"Map.addLayer(states.style(**style), {}, \"US States\")\n",
"m.add_layer(states.style(**style), {}, \"US States\")\n",
"\n",
"# Add NLCD legend\n",
"Map.add_legend(title=\"NLCD Land Cover\", builtin_legend=\"NLCD\")\n",
"Map"
"m.add_legend(title=\"NLCD Land Cover\", builtin_legend=\"NLCD\")\n",
"m"
]
},
{
Expand Down Expand Up @@ -625,11 +625,11 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"dem = ee.Image(\"USGS/3DEP/10m\")\n",
"vis = {\"min\": 0, \"max\": 4000, \"palette\": \"terrain\"}\n",
"Map.addLayer(dem, vis, \"DEM\")\n",
"Map"
"m.add_layer(dem, vis, \"DEM\")\n",
"m"
]
},
{
Expand All @@ -640,8 +640,8 @@
"outputs": [],
"source": [
"landcover = ee.Image(\"USGS/NLCD_RELEASES/2019_REL/NLCD/2019\").select(\"landcover\")\n",
"Map.addLayer(landcover, {}, \"NLCD 2019\")\n",
"Map.add_legend(title=\"NLCD Land Cover Classification\", builtin_legend=\"NLCD\")"
"m.add_layer(landcover, {}, \"NLCD 2019\")\n",
"m.add_legend(title=\"NLCD Land Cover Classification\", builtin_legend=\"NLCD\")"
]
},
{
Expand Down
54 changes: 27 additions & 27 deletions examples/workshops/Alaska_2024_Part2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"\n",
"dem = ee.Image(\"USGS/SRTMGL1_003\")\n",
"landsat7 = ee.Image(\"LANDSAT/LE7_TOA_5YEAR/1999_2003\")\n",
Expand All @@ -311,13 +311,13 @@
" \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n",
"}\n",
"\n",
"Map.addLayer(\n",
"m.add_layer(\n",
" landsat7,\n",
" {\"bands\": [\"B4\", \"B3\", \"B2\"], \"min\": 20, \"max\": 200, \"gamma\": 2},\n",
" \"Landsat 7\",\n",
")\n",
"Map.addLayer(dem, vis_params, \"SRTM DEM\", True, 1)\n",
"Map"
"m.add_layer(dem, vis_params, \"SRTM DEM\", True, 1)\n",
"m"
]
},
{
Expand All @@ -340,7 +340,7 @@
"outputs": [],
"source": [
"in_fc = geemap.shp_to_ee(in_shp)\n",
"Map.addLayer(in_fc, {}, \"Cities\")"
"m.add_layer(in_fc, {}, \"Cities\")"
]
},
{
Expand Down Expand Up @@ -398,17 +398,17 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"Map.add_basemap(\"TERRAIN\")\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"m.add_basemap(\"TERRAIN\")\n",
"\n",
"image = ee.Image(\"USGS/SRTMGL1_003\")\n",
"vis_params = {\n",
" \"min\": 0,\n",
" \"max\": 4000,\n",
" \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n",
"}\n",
"Map.addLayer(image, vis_params, \"SRTM DEM\", True, 0.5)\n",
"Map"
"m.add_layer(image, vis_params, \"SRTM DEM\", True, 0.5)\n",
"m"
]
},
{
Expand All @@ -418,13 +418,13 @@
"metadata": {},
"outputs": [],
"source": [
"line = Map.user_roi\n",
"line = m.user_roi\n",
"if line is None:\n",
" line = ee.Geometry.LineString(\n",
" [[-120.2232, 36.3148], [-118.9269, 36.7121], [-117.2022, 36.7562]]\n",
" )\n",
" Map.addLayer(line, {}, \"ROI\")\n",
"Map.centerObject(line)"
" m.add_layer(line, {}, \"ROI\")\n",
"m.centerObject(line)"
]
},
{
Expand Down Expand Up @@ -486,7 +486,7 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"\n",
"# Add NASA SRTM\n",
"dem = ee.Image(\"USGS/SRTMGL1_003\")\n",
Expand All @@ -495,18 +495,18 @@
" \"max\": 4000,\n",
" \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n",
"}\n",
"Map.addLayer(dem, dem_vis, \"SRTM DEM\")\n",
"m.add_layer(dem, dem_vis, \"SRTM DEM\")\n",
"\n",
"# Add 5-year Landsat TOA composite\n",
"landsat = ee.Image(\"LANDSAT/LE7_TOA_5YEAR/1999_2003\")\n",
"landsat_vis = {\"bands\": [\"B4\", \"B3\", \"B2\"], \"gamma\": 1.4}\n",
"Map.addLayer(landsat, landsat_vis, \"Landsat\", False)\n",
"m.add_layer(landsat, landsat_vis, \"Landsat\", False)\n",
"\n",
"# Add US Census States\n",
"states = ee.FeatureCollection(\"TIGER/2018/States\")\n",
"style = {\"fillColor\": \"00000000\"}\n",
"Map.addLayer(states.style(**style), {}, \"US States\")\n",
"Map"
"m.add_layer(states.style(**style), {}, \"US States\")\n",
"m"
]
},
{
Expand Down Expand Up @@ -555,21 +555,21 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"\n",
"# Add NLCD data\n",
"dataset = ee.Image(\"USGS/NLCD_RELEASES/2019_REL/NLCD/2019\")\n",
"landcover = dataset.select(\"landcover\")\n",
"Map.addLayer(landcover, {}, \"NLCD 2019\")\n",
"m.add_layer(landcover, {}, \"NLCD 2019\")\n",
"\n",
"# Add US census states\n",
"states = ee.FeatureCollection(\"TIGER/2018/States\")\n",
"style = {\"fillColor\": \"00000000\"}\n",
"Map.addLayer(states.style(**style), {}, \"US States\")\n",
"m.add_layer(states.style(**style), {}, \"US States\")\n",
"\n",
"# Add NLCD legend\n",
"Map.add_legend(title=\"NLCD Land Cover\", builtin_legend=\"NLCD\")\n",
"Map"
"m.add_legend(title=\"NLCD Land Cover\", builtin_legend=\"NLCD\")\n",
"m"
]
},
{
Expand Down Expand Up @@ -625,11 +625,11 @@
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"dem = ee.Image(\"USGS/3DEP/10m\")\n",
"vis = {\"min\": 0, \"max\": 4000, \"palette\": \"terrain\"}\n",
"Map.addLayer(dem, vis, \"DEM\")\n",
"Map"
"m.add_layer(dem, vis, \"DEM\")\n",
"m"
]
},
{
Expand All @@ -640,8 +640,8 @@
"outputs": [],
"source": [
"landcover = ee.Image(\"USGS/NLCD_RELEASES/2019_REL/NLCD/2019\").select(\"landcover\")\n",
"Map.addLayer(landcover, {}, \"NLCD 2019\")\n",
"Map.add_legend(title=\"NLCD Land Cover Classification\", builtin_legend=\"NLCD\")"
"m.add_layer(landcover, {}, \"NLCD 2019\")\n",
"m.add_legend(title=\"NLCD Land Cover Classification\", builtin_legend=\"NLCD\")"
]
},
{
Expand Down

0 comments on commit 1a44ea4

Please sign in to comment.