Mapbox - COG Layers¶
Cloud Optimized GeoTIFF (COG) layers for raster visualization.
In [ ]:
Copied!
# %pip install anymap-ts
# %pip install anymap-ts
Add COG Layer¶
NLCD Land Cover data from AWS.
In [ ]:
Copied!
from anymap_ts import MapboxMap
m = MapboxMap(
center=[-98, 39],
zoom=4,
style="mapbox://styles/mapbox/satellite-streets-v12",
)
cog_url = "https://s3.us-east-1.amazonaws.com/ds-deck.gl-raster-public/cog/Annual_NLCD_LndCov_2024_CU_C1V1.tif"
m.add_cog_layer(cog_url, name="nlcd", opacity=0.8)
m
from anymap_ts import MapboxMap
m = MapboxMap(
center=[-98, 39],
zoom=4,
style="mapbox://styles/mapbox/satellite-streets-v12",
)
cog_url = "https://s3.us-east-1.amazonaws.com/ds-deck.gl-raster-public/cog/Annual_NLCD_LndCov_2024_CU_C1V1.tif"
m.add_cog_layer(cog_url, name="nlcd", opacity=0.8)
m
Opacity Control¶
Adjust COG layer opacity.
In [ ]:
Copied!
m.set_opacity("nlcd", 0.5)
m.set_opacity("nlcd", 0.5)
Remove COG Layer¶
In [ ]:
Copied!
m.remove_cog_layer("nlcd")
m.remove_cog_layer("nlcd")