Skip to content

Commit 8cb064a

Browse files
giswqspre-commit-ci[bot]Copilot
authored
Update AGU notebook example (#1277)
* Update AGU notebook example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Install dependencies * Update docs/workshops/AGU_2025.ipynb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a6741a1 commit 8cb064a

1 file changed

Lines changed: 24 additions & 56 deletions

File tree

docs/workshops/AGU_2025.ipynb

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"# 👁️ 2 - Interactive visualization of raster and vector data\n",
8+
"# Interactive visualization of raster and vector data\n",
99
"\n",
1010
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/leafmap/blob/master/docs/workshops/AGU_2025.ipynb)\n",
1111
"\n",
1212
"## Introduction\n",
1313
"\n",
14-
"This notebook is for the workshop ([Open Source Geospatial Workflows in the Cloud](https://geojupyter.github.io/workshop-open-source-geospatial)) presented at the [AGU Fall Meeting 2025](https://agu.confex.com/agu/agu25/meetingapp.cgi/Session/252640).\n",
14+
"This notebook is for the workshop ([Open Source Geospatial Workflows in the Cloud](https://agu2025.workshops.geojupyter.org/)) presented at the [AGU Fall Meeting 2025](https://agu.confex.com/agu/agu25/meetingapp.cgi/Session/252640).\n",
1515
"\n",
1616
"### Learning Objectives\n",
1717
"\n",
@@ -25,7 +25,6 @@
2525
"- Use TiTiler for dynamic raster tile serving\n",
2626
"- Apply custom styling and legends to enhance map readability\n",
2727
"\n",
28-
"\n",
2928
"## Useful Resources\n",
3029
"\n",
3130
"- [MapLibre GL JS Documentation](https://maplibre.org/maplibre-gl-js/docs): Comprehensive documentation for MapLibre GL JS.\n",
@@ -34,40 +33,6 @@
3433
"- [Video Tutorials](https://bit.ly/maplibre): Video guides for practical MapLibre skills.\n",
3534
"- [MapLibre Demos](https://maps.gishub.org): Interactive demos showcasing MapLibre's capabilities.\n",
3635
"\n",
37-
"## Table of Contents\n",
38-
"\n",
39-
"- [Installation and Setup](#installation-and-setup)\n",
40-
"- [Creating Interactive Maps](#creating-interactive-maps)\n",
41-
" - [Basic Map Setup](#basic-map-setup)\n",
42-
" - [Customizing the Map's Center and Zoom Level](#customizing-the-maps-center-and-zoom-level)\n",
43-
" - [Choosing a Basemap Style](#choosing-a-basemap-style)\n",
44-
"- [Adding Map Controls](#adding-map-controls)\n",
45-
"- [Adding Layers](#adding-layers)\n",
46-
" - [Adding Basemaps](#adding-basemaps)\n",
47-
" - [Adding XYZ Tile Layer](#adding-xyz-tile-layer)\n",
48-
" - [Adding WMS Layer](#adding-wms-layer)\n",
49-
"- [3D Terrain](#3d-terrain)\n",
50-
" - [3D Terrain](#3d-terrain)\n",
51-
" - [3D Buildings](#3d-buildings)\n",
52-
" - [3D Indoor Mapping](#3d-indoor-mapping)\n",
53-
"- [Visualizing Vector Data](#visualizing-vector-data)\n",
54-
" - [Point Data](#point-data)\n",
55-
" - [Line Data](#line-data)\n",
56-
" - [Polygon Data](#polygon-data)\n",
57-
"- [Visualizing Remote Sensing Data](#visualizing-remote-sensing-data)\n",
58-
" - [Local Raster Data](#local-raster-data)\n",
59-
" - [Cloud Optimized GeoTIFF (COG)](#cloud-optimized-geotiff-cog)\n",
60-
" - [STAC Layer](#stac-layer)\n",
61-
"- [Adding Components to the Map](#adding-components-to-the-map)\n",
62-
" - [Adding Color bar](#adding-color-bar)\n",
63-
" - [Adding Legend](#adding-legend)\n",
64-
" - [Adding Video](#adding-video)\n",
65-
"- [PMTiles](#pmtiles)\n",
66-
" - [Building Footprint Data](#building-footprint-data)\n",
67-
" - [Fields of The World](#fields-of-the-world)\n",
68-
" - [3D PMTiles](#3d-pmtiles)\n",
69-
"- [H3 Hexagonal Grid](#h3-hexagonal-grid)\n",
70-
"\n",
7136
"## Installation and Setup\n",
7237
"\n",
7338
"To install the required packages, uncomment and run the line below."
@@ -80,7 +45,7 @@
8045
"metadata": {},
8146
"outputs": [],
8247
"source": [
83-
"# %pip install -U leafmap"
48+
"# %pip install -U leafmap localtileserver rioxarray mapclassify pmtiles"
8449
]
8550
},
8651
{
@@ -679,7 +644,7 @@
679644
"metadata": {},
680645
"outputs": [],
681646
"source": [
682-
"m = leafmap.Map(style=\"streets\")\n",
647+
"m = leafmap.Map()\n",
683648
"m.add_raster(filepath, indexes=[3, 2, 1], vmin=0, vmax=100, name=\"Landsat-321\")\n",
684649
"m.add_raster(filepath, indexes=[4, 3, 2], vmin=0, vmax=100, name=\"Landsat-432\")\n",
685650
"m"
@@ -771,7 +736,7 @@
771736
"metadata": {},
772737
"outputs": [],
773738
"source": [
774-
"m = leafmap.Map(style=\"streets\")\n",
739+
"m = leafmap.Map()\n",
775740
"url = \"https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json\"\n",
776741
"m.add_stac_layer(url, bands=[\"pan\"], name=\"Panchromatic\", vmin=0, vmax=150)\n",
777742
"m.add_stac_layer(url, bands=[\"B4\", \"B3\", \"B2\"], name=\"RGB\", vmin=0, vmax=150)\n",
@@ -826,6 +791,7 @@
826791
"### Adding Color bar\n",
827792
"\n",
828793
"Adding a color bar enhances data interpretation. In the example:\n",
794+
"\n",
829795
"1. A Digital Elevation Model (DEM) is displayed with a color ramp from 0 to 1500 meters.\n",
830796
"2. `add_colorbar` method is used to create a color bar with labels, adjusting its position, opacity, and orientation for optimal readability."
831797
]
@@ -944,6 +910,7 @@
944910
"### Adding Legend\n",
945911
"\n",
946912
"Custom legends help users understand data classifications. Two methods are shown:\n",
913+
"\n",
947914
"1. Using built-in legends, such as for NLCD (National Land Cover Database) or wetland types.\n",
948915
"2. Custom legends are built with a dictionary of land cover types and colors. This legend provides descriptive color-coding for various land cover types, with configurable background opacity to blend with the map."
949916
]
@@ -1109,7 +1076,7 @@
11091076
"source": [
11101077
"### Building Footprint Data\n",
11111078
"\n",
1112-
"Visualize the [Google-Microsoft Open Buildings dataset](https://beta.source.coop/repositories/vida/google-microsoft-open-buildings/description), managed by VIDA, in PMTiles format. Fetch metadata to identify available layers, apply custom styles to the building footprints, and render them with semi-transparent colors for a clear visualization."
1079+
"Visualize the [Google-Microsoft Open Buildings dataset](https://source.coop/vida/google-microsoft-osm-open-buildings), managed by VIDA, in PMTiles format. Fetch metadata to identify available layers, apply custom styles to the building footprints, and render them with semi-transparent colors for a clear visualization."
11131080
]
11141081
},
11151082
{
@@ -1446,18 +1413,21 @@
14461413
"### Key Takeaways\n",
14471414
"\n",
14481415
"1. **Choose the Right Format**:\n",
1416+
"\n",
14491417
" - Use COGs for large raster datasets in cloud storage\n",
14501418
" - Use PMTiles for vector data (buildings, boundaries, points of interest)\n",
14511419
" - Use TiTiler when you need dynamic rendering with custom parameters\n",
14521420
" - Use STAC for organized collections of geospatial assets\n",
14531421
"\n",
14541422
"2. **Performance Optimization**:\n",
1423+
"\n",
14551424
" - Leverage cloud-native formats (COG, PMTiles) for better performance\n",
14561425
" - Use appropriate zoom levels and bounds to limit data loading\n",
14571426
" - Apply data rescaling and color mapping efficiently\n",
14581427
" - Consider using `before_id` parameter to control layer ordering\n",
14591428
"\n",
14601429
"3. **Visualization Best Practices**:\n",
1430+
"\n",
14611431
" - Add legends and color bars to make your maps interpretable\n",
14621432
" - Use appropriate color schemes for your data type (sequential, diverging, categorical)\n",
14631433
" - Leverage 3D visualizations (terrain, buildings) when appropriate\n",
@@ -1483,25 +1453,23 @@
14831453
}
14841454
],
14851455
"metadata": {
1456+
"authors": [
1457+
{
1458+
"affiliations": [
1459+
"University of Tennessee, Knoxville"
1460+
],
1461+
"email": "qwu18@utk.edu",
1462+
"github": "giswqs",
1463+
"name": "Qiusheng Wu",
1464+
"orcid": "0000-0001-5437-4073"
1465+
}
1466+
],
1467+
"execute": false,
14861468
"jupytext": {
14871469
"default_lexer": "ipython3"
14881470
},
1489-
"kernelspec": {
1490-
"display_name": "geo",
1491-
"language": "python",
1492-
"name": "python3"
1493-
},
14941471
"language_info": {
1495-
"codemirror_mode": {
1496-
"name": "ipython",
1497-
"version": 3
1498-
},
1499-
"file_extension": ".py",
1500-
"mimetype": "text/x-python",
1501-
"name": "python",
1502-
"nbconvert_exporter": "python",
1503-
"pygments_lexer": "ipython3",
1504-
"version": "3.12.9"
1472+
"name": "python"
15051473
}
15061474
},
15071475
"nbformat": 4,

0 commit comments

Comments
 (0)