Uncomment the following line to install geemap if needed.
# !pip install geemap
import geemap
# geemap.update_package()
Map = geemap.Map(center=[0, 0], zoom=2)
in_geojson = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/cable_geo.geojson"
Map.add_geojson(in_geojson, layer_name="Cable lines")
Map
Map = geemap.Map(center=[0, 0], zoom=2)
url = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.geojson"
Map.add_geojson(
url, layer_name="Countries", fill_colors=["red", "yellow", "green", "orange"]
)
Map
import random
Map = geemap.Map(center=[0, 0], zoom=2)
url = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.geojson"
def random_color(feature):
return {
"color": "black",
"fillColor": random.choice(["red", "yellow", "green", "orange"]),
}
Map.add_geojson(url, layer_name="Countries", style_callback=random_color)
Map
Map = geemap.Map(center=[0, 0], zoom=2)
url = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.geojson"
style = {
"stroke": True,
"color": "#0000ff",
"weight": 2,
"opacity": 1,
"fill": True,
"fillColor": "#0000ff",
"fillOpacity": 0.1,
}
hover_style = {"fillOpacity": 0.7}
Map.add_geojson(url, layer_name="Countries", style=style, hover_style=hover_style)
Map
url = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.zip"
geemap.download_file(url)
Uncomment to install PyCRS
as needed
# !pip install PyCRS
Map = geemap.Map(center=[0, 0], zoom=2)
in_shp = "countries.shp"
Map.add_shapefile(in_shp, layer_name="Countries")
Map
Map = geemap.Map()
in_kml = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/us_states.kml"
Map.add_kml(in_kml, layer_name="US States KML")
Map
Map = geemap.Map(center=[0, 0], zoom=2)
url = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.geojson"
Map.add_vector(
url, layer_name="Countries", fill_colors=["red", "yellow", "green", "orange"]
)
Map
import geemap.foliumap as geemap
Map = geemap.Map()
in_shp = "countries.shp"
in_geojson = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/us_states.json"
in_kml = "./us_states.kml" # the kml visualization above downloads this file
Map.add_shapefile(in_shp, layer_name="Shapefile")
Map.add_geojson(in_geojson, layer_name="GeoJSON")
Map.add_kml(in_kml, layer_name="KML")
Map