83 local tile
Using local raster datasets or remote Cloud Optimized GeoTIFFs (COG) with geemap
Uncomment the following line to install geemap and localtileserver if needed.
In [ ]:
Copied!
# !pip install geemap localtileserver
# !pip install geemap localtileserver
In [ ]:
Copied!
import os
import geemap
import os
import geemap
Specify input raster datasets
In [ ]:
Copied!
out_dir = os.path.expanduser("~/Downloads")
if not os.path.exists(out_dir):
os.makedirs(out_dir)
dem = os.path.join(out_dir, "dem.tif")
out_dir = os.path.expanduser("~/Downloads")
if not os.path.exists(out_dir):
os.makedirs(out_dir)
dem = os.path.join(out_dir, "dem.tif")
Download samples raster datasets.
In [ ]:
Copied!
if not os.path.exists(dem):
dem_url = "https://drive.google.com/file/d/1vRkAWQYsLWCi6vcTMk8vLxoXMFbdMFn8/view?usp=sharing"
geemap.download_file(dem_url, dem, unzip=False)
if not os.path.exists(dem):
dem_url = "https://drive.google.com/file/d/1vRkAWQYsLWCi6vcTMk8vLxoXMFbdMFn8/view?usp=sharing"
geemap.download_file(dem_url, dem, unzip=False)
Create an interactive map.
In [ ]:
Copied!
m = geemap.Map()
m = geemap.Map()
Add local raster datasets to the map. The available palettes can be found at https://jiffyclub.github.io/palettable/
In [ ]:
Copied!
m.add_raster(dem, colormap="terrain", layer_name="DEM")
m.add_raster(dem, colormap="terrain", layer_name="DEM")
In [ ]:
Copied!
m
m
Add a remote Cloud Optimized GeoTIFF(COG) to the map.
In [ ]:
Copied!
m = geemap.Map()
m = geemap.Map()
In [ ]:
Copied!
url = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif"
url = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif"
In [ ]:
Copied!
m.add_remote_tile(url, layer_name="CA Fire")
m.add_remote_tile(url, layer_name="CA Fire")
In [ ]:
Copied!
m
m