Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install geemap
# !pip install geemap
In [ ]:
Copied!
import geemap
import geemap
In [ ]:
Copied!
# geemap.update_package()
# geemap.update_package()
In [ ]:
Copied!
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)
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
In [ ]:
Copied!
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
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
In [ ]:
Copied!
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
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
In [ ]:
Copied!
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
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
In [ ]:
Copied!
url = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.zip"
geemap.download_file(url)
url = "https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.zip"
geemap.download_file(url)
Uncomment to install PyCRS
as needed
In [ ]:
Copied!
# !pip install PyCRS
# !pip install PyCRS
In [ ]:
Copied!
Map = geemap.Map(center=[0, 0], zoom=2)
in_shp = "countries.shp"
Map.add_shapefile(in_shp, layer_name="Countries")
Map
Map = geemap.Map(center=[0, 0], zoom=2)
in_shp = "countries.shp"
Map.add_shapefile(in_shp, layer_name="Countries")
Map
In [ ]:
Copied!
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()
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
In [ ]:
Copied!
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
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
For folium¶
In [ ]:
Copied!
import geemap.foliumap as geemap
import geemap.foliumap as geemap
In [ ]:
Copied!
Map = geemap.Map()
Map = geemap.Map()
In [ ]:
Copied!
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
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
In [ ]:
Copied!
Map.add_shapefile(in_shp, layer_name="Shapefile")
Map.add_shapefile(in_shp, layer_name="Shapefile")
In [ ]:
Copied!
Map.add_geojson(in_geojson, layer_name="GeoJSON")
Map.add_geojson(in_geojson, layer_name="GeoJSON")
In [ ]:
Copied!
Map.add_kml(in_kml, layer_name="KML")
Map.add_kml(in_kml, layer_name="KML")
In [ ]:
Copied!
Map
Map