Cloud optimized geotiff

Visualize Cloud Optimized GeoTIFF (COG)
This notebook demonstrates how to visualize Cloud Optimized GeoTIFF (COG) files using the TiTiler demo endpoint (titiler.opengeos.org). Please be gentle with the demo endpoint.
Uncomment the following line to install leafmap if needed.
| # %pip install "leafmap[maplibre]"
|
| import leafmap.maplibregl as leafmap
|
To run this notebook, you will need an API key from MapTiler. Once you have the API key, you can uncomment the following code block and replace YOUR_API_KEY with your actual API key. Then, run the code block code to set the API key as an environment variable.
| # import os
# os.environ["MAPTILER_KEY"] = "YOUR_API_KEY"
|
| m = leafmap.Map(style="satellite")
before = (
"https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-07-01.tif"
)
after = (
"https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-09-13.tif"
)
m.add_cog_layer(before, name="Before", attribution="Maxar")
m.add_cog_layer(after, name="After", attribution="Maxar", fit_bounds=True)
m
|

| m = leafmap.Map(style="satellite")
dem = "https://github.com/opengeos/datasets/releases/download/raster/srtm90.tif"
m.add_cog_layer(dem, name="DEM", colormap_name="terrain", fit_bounds=True)
m
|
