Google earth
Create raster tiles for rendering in Google Earth
Create raster tiles for rendering in Google Earth at https://earth.google.com.
Uncomment the following line to install leafmap if needed.
In [ ]:
Copied!
# %pip install leafmap geemap
# %pip install leafmap geemap
In [ ]:
Copied!
import os
import ee
from leafmap import get_ee_tile_url, cog_tile
import os
import ee
from leafmap import get_ee_tile_url, cog_tile
In [ ]:
Copied!
ee.Authenticate()
ee.Initialize(project="your-ee-project")
ee.Authenticate()
ee.Initialize(project="your-ee-project")
In [ ]:
Copied!
esa_dataset = ee.ImageCollection("ESA/WorldCover/v200").first()
vis_params = {"bands": ["Map"]}
tile_url = get_ee_tile_url(esa_dataset, vis_params)
print(tile_url)
esa_dataset = ee.ImageCollection("ESA/WorldCover/v200").first()
vis_params = {"bands": ["Map"]}
tile_url = get_ee_tile_url(esa_dataset, vis_params)
print(tile_url)
In [ ]:
Copied!
dem_dataset = ee.Image("NASA/NASADEM_HGT/001").select("elevation")
vis_params = {"min": 0, "max": 4000, "palette": "terrain"}
tile_url = get_ee_tile_url(dem_dataset, vis_params)
print(tile_url)
dem_dataset = ee.Image("NASA/NASADEM_HGT/001").select("elevation")
vis_params = {"min": 0, "max": 4000, "palette": "terrain"}
tile_url = get_ee_tile_url(dem_dataset, vis_params)
print(tile_url)
In [ ]:
Copied!
os.environ["TITILER_ENDPOINT"] = "https://titiler.xyz"
os.environ["TITILER_ENDPOINT"] = "https://titiler.xyz"
In [ ]:
Copied!
dem_url = "https://github.com/opengeos/datasets/releases/download/raster/dem_90m.tif"
tile_url = cog_tile(dem_url, colormap_name="terrain")
print(tile_url)
dem_url = "https://github.com/opengeos/datasets/releases/download/raster/dem_90m.tif"
tile_url = cog_tile(dem_url, colormap_name="terrain")
print(tile_url)
In [ ]:
Copied!
nlcd_url = "https://github.com/opengeos/datasets/releases/download/raster/nlcd_2021_land_cover_30m.tif"
colormap = {
"11": "#466b9f",
"12": "#d1def8",
"21": "#dec5c5",
"22": "#d99282",
"23": "#eb0000",
"24": "#ab0000",
"31": "#b3ac9f",
"41": "#68ab5f",
"42": "#1c5f2c",
"43": "#b5c58f",
"51": "#af963c",
"52": "#ccb879",
"71": "#dfdfc2",
"72": "#d1d182",
"73": "#a3cc51",
"74": "#82ba9e",
"81": "#dcd939",
"82": "#ab6c28",
"90": "#b8d9eb",
"95": "#6c9fb8",
}
tile_url = cog_tile(nlcd_url, colormap=colormap)
print(tile_url)
nlcd_url = "https://github.com/opengeos/datasets/releases/download/raster/nlcd_2021_land_cover_30m.tif"
colormap = {
"11": "#466b9f",
"12": "#d1def8",
"21": "#dec5c5",
"22": "#d99282",
"23": "#eb0000",
"24": "#ab0000",
"31": "#b3ac9f",
"41": "#68ab5f",
"42": "#1c5f2c",
"43": "#b5c58f",
"51": "#af963c",
"52": "#ccb879",
"71": "#dfdfc2",
"72": "#d1d182",
"73": "#a3cc51",
"74": "#82ba9e",
"81": "#dcd939",
"82": "#ab6c28",
"90": "#b8d9eb",
"95": "#6c9fb8",
}
tile_url = cog_tile(nlcd_url, colormap=colormap)
print(tile_url)