45 cog mosaic
Uncomment the following line to install geemap if needed.
Important Note: This notebook no longer works. The add_cog_mosaic()
has been removed from geemap. See https://github.com/giswqs/leafmap/issues/180
In [ ]:
Copied!
# !pip install geemap
# !pip install geemap
In [ ]:
Copied!
import geemap
import geemap
In [ ]:
Copied!
# geemap.update_package()
# geemap.update_package()
In [ ]:
Copied!
Map = geemap.Map(ee_initialize=False, layer_ctrl=True, toolbar_ctrl=False)
Map
Map = geemap.Map(ee_initialize=False, layer_ctrl=True, toolbar_ctrl=False)
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 here.
In [ ]:
Copied!
URL = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/cog_files.txt"
URL = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/cog_files.txt"
In [ ]:
Copied!
import urllib
data = urllib.request.urlopen(URL)
links = []
for line in data:
links.append(line.decode("utf-8").strip())
import urllib
data = urllib.request.urlopen(URL)
links = []
for line in data:
links.append(line.decode("utf-8").strip())
In [ ]:
Copied!
links = links[1:] # remove the first line that does not contain .tif
links = links[1:] # remove the first line that does not contain .tif
In [ ]:
Copied!
# links
# links
In [ ]:
Copied!
Map.add_cog_mosaic(links, name="CA Fire", show_footprints=True, verbose=True)
Map.add_cog_mosaic(links, name="CA Fire", show_footprints=True, verbose=True)
In [ ]:
Copied!
Map.addLayerControl()
Map
Map.addLayerControl()
Map