Uncomment the following line to install geemap if needed.
# !pip install geemap
import geemap
If you are using a recently implemented geemap feature that has not yet been released to PyPI or conda-forge, you can uncomment the following line to install the development version from GitHub.
# geemap.update_package()
Provide a dataset path or URL.
url = "https://github.com/giswqs/data/raw/main/raster/srtm90.tif"
Validate COG.
geemap.cog_validate(url)
geemap.cog_validate(url, verbose=True)
Convert the image to tiled COG.
out_cog = "cog.tif"
geemap.image_to_cog(url, out_cog)
Validate COG.
geemap.cog_validate(out_cog)
geemap.cog_validate(out_cog, verbose=True)
Add COG to map.
m = geemap.Map()
m.add_raster(out_cog, palette="dem", layer_name="Local COG")
m.add_cog_layer(url, palette="gist_earth", name="Remote COG")
m