|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import leafmap.foliumap as leafmap |
|
|
|
|
|
|
|
from pathlib import Path |
|
|
|
files = [path for path in Path('.').glob('**/*.tif')] |
|
done = [path for path in Path('.').glob('cogs/*.tif')] |
|
|
|
|
|
|
|
B = [x.name for x in done] |
|
A = [x.name.lower() for x in files] |
|
C=[i for i in A if i not in B] |
|
C |
|
|
|
|
|
|
|
for x in inputs: |
|
dest = "cogs/" + x.name.lower() |
|
leafmap.image_to_cog(str(x), dest) |
|
|
|
|
|
|
|
|
|
m = leafmap.Map(center=[35, -100], zoom=3) |
|
|
|
|
|
m.add_cog_layer("https://data.source.coop/cboettig/carbon/cogs/irrecoverable_c_total_2018.tif", palette="reds", name="irrecoverable carbon", transparent_bg=True, opacity = 0.8) |
|
m.add_cog_layer("https://data.source.coop/cboettig/carbon/cogs/vulnerable_c_total_2018.tif", palette="purples", name="vulnerable carbon", transparent_bg=True, opacity = 0.8) |
|
m.add_cog_layer("https://data.source.coop/cboettig/carbon/cogs/manageable_c_total_2018.tif", palette="greens", name="manageable carbon", transparent_bg=True, opacity = 0.8) |
|
|
|
m.to_html("map.html") |
|
|
|
m |
|
|