04 cog mosaic

Creating a virtual mosaic of Cloud Optimized GeoTIFFs (COG)
Uncomment the following line to install leafmap if needed.
Important Note: This notebook no longer works. The add_cog_mosaic() has been removed from leafmap. See https://github.com/opengeos/leafmap/issues/180
| # leafmap.update_package()
|
Create an interactive map.
For this demo, we will use data from https://www.maxar.com/open-data/california-colorado-fires for mapping California and Colorado fires. A List of COGs can be found at:
- Pre-event: https://github.com/opengeos/leafmap/blob/master/examples/data/cog_pre_event.txt
- Post-event: https://github.com/opengeos/leafmap/blob/master/examples/data/cog_post_event.txt
| pre_fire_url = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/cog_pre_event.txt"
|
Create an XYZ tile layer based on a txt file containing a list of COG URLs.
| # leafmap.cog_mosaic_from_file(pre_fire_url)
|
| post_fire_url = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/cog_post_event.txt"
|
| # leafmap.cog_mosaic_from_file(post_fire_url)
|
Add a COG mosaic tile layer to the map.
| # m.add_cog_mosaic_from_file(pre_fire_url, name="Pre-event", show_footprints=True) #This line might take a while to run
|
| # m.add_cog_mosaic_from_file(post_fire_url, name="Post-event", show_footprints=True) #This line might take a while to run
|
| pre_event_tile = "https://titiler.opengeos.org/mosaicjson/anonymous.layer_pqmra/tiles/{z}/{x}/{y}@1x?"
m.add_tile_layer(pre_event_tile, name="Pre-event", attribution="Maxar")
|
| post_event_tile = "https://titiler.opengeos.org/mosaicjson/anonymous.layer_qdano/tiles/{z}/{x}/{y}@1x?"
m.add_tile_layer(post_event_tile, name="Post-event", attribution="Maxar")
|
| m.set_center(-122.0828, 37.0317, 11)
|