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 [1]:
Copied!
# !pip install geemap
# !pip install geemap
In [2]:
Copied!
import geemap
import geemap
In [3]:
Copied!
# geemap.update_package()
# geemap.update_package()
In [4]:
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
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook
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 [5]:
Copied!
URL = (
'https://raw.githubusercontent.com/giswqs/geemap/master/examples/data/cog_files.txt'
)
URL = (
'https://raw.githubusercontent.com/giswqs/geemap/master/examples/data/cog_files.txt'
)
In [6]:
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 [7]:
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 [8]:
Copied!
# links
# links
In [9]:
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)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Input In [9], in <cell line: 1>() ----> 1 Map.add_cog_mosaic(links, name="CA Fire", show_footprints=True, verbose=True) TypeError: add_cog_mosaic() takes 1 positional argument but 2 were given
In [10]:
Copied!
Map.addLayerControl()
Map
Map.addLayerControl()
Map
Out[10]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Last update:
2022-03-14