106 kepler gl
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install -U geemap
# !pip install -U geemap
In [ ]:
Copied!
import geemap.kepler as geemap
import geemap.kepler as geemap
Create an interactive map. You can specify various parameters to initialize the map, such as center
, zoom
, height
, and widescreen
.
In [ ]:
Copied!
m = geemap.Map(center=[40, -100], zoom=2, height=600, widescreen=False)
m
m = geemap.Map(center=[40, -100], zoom=2, height=600, widescreen=False)
m
Save the map to an interactive html. To hide the side panel and disable map customization. Set read_only=False
In [ ]:
Copied!
m.to_html(filename="kepler.html", read_only=False)
m.to_html(filename="kepler.html", read_only=False)
Display the interactive map in a notebook cell.
In [ ]:
Copied!
# m.static_map(width=950, height=600, read_only=True)
# m.static_map(width=950, height=600, read_only=True)
Add a GeoJSON to the map.
In [ ]:
Copied!
m = geemap.Map(center=[20, 0], zoom=1)
lines = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/cable_geo.geojson"
m.add_geojson(lines, layer_name="Cable lines")
m
m = geemap.Map(center=[20, 0], zoom=1)
lines = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/cable_geo.geojson"
m.add_geojson(lines, layer_name="Cable lines")
m
In [ ]:
Copied!
m.to_html("kepler_lines.html")
m.to_html("kepler_lines.html")
Add a GeoJSON with US state boundaries to the map.
In [ ]:
Copied!
m = geemap.Map(center=[50, -110], zoom=2)
polygons = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_states.json"
m.add_geojson(polygons, layer_name="Countries")
m
m = geemap.Map(center=[50, -110], zoom=2)
polygons = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_states.json"
m.add_geojson(polygons, layer_name="Countries")
m
Add a shapefile to the map.
In [ ]:
Copied!
m = geemap.Map(center=[20, 0], zoom=1)
in_shp = (
"https://github.com/gee-community/geemap/raw/master/examples/data/countries.zip"
)
m.add_shp(in_shp, "Countries")
m
m = geemap.Map(center=[20, 0], zoom=1)
in_shp = (
"https://github.com/gee-community/geemap/raw/master/examples/data/countries.zip"
)
m.add_shp(in_shp, "Countries")
m
Add a GeoPandas GeoDataFrame to the map.
In [ ]:
Copied!
import geopandas as gpd
import geopandas as gpd
In [ ]:
Copied!
gdf = gpd.read_file(
"https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/world_cities.geojson"
)
gdf = gpd.read_file(
"https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/world_cities.geojson"
)
In [ ]:
Copied!
gdf
gdf
In [ ]:
Copied!
m = geemap.Map(center=[20, 0], zoom=1)
m.add_gdf(gdf, "World cities")
m
m = geemap.Map(center=[20, 0], zoom=1)
m.add_gdf(gdf, "World cities")
m