91 raster viz gui
In [1]:
Copied!
# %pip install -U leafmap
# %pip install -U leafmap
In [2]:
Copied!
from leafmap import leafmap
from leafmap import leafmap
Visualizing local raster data¶
In [3]:
Copied!
filename = "landsat.tif"
landsat_url = (
"https://github.com/opengeos/datasets/releases/download/raster/landsat.tif"
)
leafmap.download_file(landsat_url, filename, overwrite=True)
filename = "landsat.tif"
landsat_url = (
"https://github.com/opengeos/datasets/releases/download/raster/landsat.tif"
)
leafmap.download_file(landsat_url, filename, overwrite=True)
Downloading... From: https://github.com/opengeos/datasets/releases/download/raster/landsat.tif To: /home/runner/work/leafmap/leafmap/docs/notebooks/landsat.tif
0%| | 0.00/10.1M [00:00<?, ?B/s]
100%|██████████| 10.1M/10.1M [00:00<00:00, 177MB/s]
Out[3]:
'/home/runner/work/leafmap/leafmap/docs/notebooks/landsat.tif'
In [4]:
Copied!
m = leafmap.Map()
m.add_raster(filename, indexes=[3, 2, 1], vmin=0, vmax=100, layer_name="Landsat")
m.add("layer_manager")
m
m = leafmap.Map()
m.add_raster(filename, indexes=[3, 2, 1], vmin=0, vmax=100, layer_name="Landsat")
m.add("layer_manager")
m
Visualizing Cloud Optimized GeoTIFF (COG)¶
In [5]:
Copied!
m = leafmap.Map()
url = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif"
m.add_cog_layer(url, bands=["b1", "b2", "b3"], name="Libya")
m.add("layer_manager")
m
m = leafmap.Map()
url = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif"
m.add_cog_layer(url, bands=["b1", "b2", "b3"], name="Libya")
m.add("layer_manager")
m
Visualizing SpatioTemporal Asset Catalog (STAC)¶
In [6]:
Copied!
m = leafmap.Map()
url = "https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json"
m.add_stac_layer(url, bands=["B4", "B3", "B2"], name="SPOT")
m.add("layer_manager")
m
m = leafmap.Map()
url = "https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json"
m.add_stac_layer(url, bands=["B4", "B3", "B2"], name="SPOT")
m.add("layer_manager")
m