107 pydeck
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install -U geemap
# !pip install -U geemap
In [ ]:
Copied!
import ee
import geemap.deck as geemap
import ee
import geemap.deck as geemap
Create an interactive map.
In [ ]:
Copied!
m = geemap.Map(center=(40, -100), zoom=3)
m
m = geemap.Map(center=(40, -100), zoom=3)
m
Add basemap.
In [ ]:
Copied!
m = geemap.Map()
m.add_basemap("HYBRID")
m
m = geemap.Map()
m.add_basemap("HYBRID")
m
Add vector data to the map. It supports any GeoPandas supported format, such as GeoJSON, shapefile, KML.
In [ ]:
Copied!
m = geemap.Map()
filename = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_states.geojson"
)
m.add_vector(filename, random_color_column="STATEFP")
m
m = geemap.Map()
filename = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_states.geojson"
)
m.add_vector(filename, random_color_column="STATEFP")
m
Add a GeoPandas GeoDataFrame to the map.
In [ ]:
Copied!
import geopandas as gpd
import geopandas as gpd
In [ ]:
Copied!
url = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_counties.geojson"
)
gdf = gpd.read_file(url)
url = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_counties.geojson"
)
gdf = gpd.read_file(url)
In [ ]:
Copied!
m = geemap.Map()
m.add_gdf(gdf, random_color_column="STATEFP")
m
m = geemap.Map()
m.add_gdf(gdf, random_color_column="STATEFP")
m
Create a 3D view of the map. Press Ctrl and hold down the left mouse button to rotate the 3D view.
In [ ]:
Copied!
initial_view_state = {
"latitude": 40,
"longitude": -100,
"zoom": 3,
"pitch": 45,
"bearing": 10,
}
m = geemap.Map(initial_view_state=initial_view_state)
filename = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_states.geojson"
)
m.add_vector(
filename,
random_color_column="STATEFP",
extruded=True,
get_elevation="ALAND",
elevation_scale=0.000001,
)
m
initial_view_state = {
"latitude": 40,
"longitude": -100,
"zoom": 3,
"pitch": 45,
"bearing": 10,
}
m = geemap.Map(initial_view_state=initial_view_state)
filename = (
"https://github.com/giswqs/streamlit-geospatial/raw/master/data/us_states.geojson"
)
m.add_vector(
filename,
random_color_column="STATEFP",
extruded=True,
get_elevation="ALAND",
elevation_scale=0.000001,
)
m
Add Earth Engine layers.
In [ ]:
Copied!
Map = geemap.Map(center=(40, -100), zoom=3)
dem = ee.Image('USGS/SRTMGL1_003')
vis_params = {
'min': 0,
'max': 4000,
'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5'],
}
Map.addLayer(dem, vis_params, 'SRTM DEM')
Map
Map = geemap.Map(center=(40, -100), zoom=3)
dem = ee.Image('USGS/SRTMGL1_003')
vis_params = {
'min': 0,
'max': 4000,
'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5'],
}
Map.addLayer(dem, vis_params, 'SRTM DEM')
Map
Last update:
2023-04-06
Created: 2020-06-29
Created: 2020-06-29