Folium Demo¶
Introducing the geonexus Python package for interactive mapping
Uncomment the following line to install geonexus if needed.
InĀ [1]:
Copied!
# !pip install geonexus
# !pip install geonexus
geonexus
has two plotting backends: folium, and ipyleaflet. Note that the backends do not offer equal functionality. Some interactive functionality in geonexus
might not be available in other plotting backends. To use a specific plotting backend, use one of the following:
import geonexus.geonexus as geonexus
import geonexus.foliumap as geonexus
InĀ [2]:
Copied!
import geonexus.foliumap as geonexus
import geonexus.foliumap as geonexus
Create an interactive map.
InĀ [3]:
Copied!
self = geonexus.Map()
self
self = geonexus.Map()
self
Out[3]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Importing a geojson file and specify the default map center (Niger) and zoom level.
InĀ [4]:
Copied!
self = geonexus.Map(center=[17.6078, 8.0817], zoom=6)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
self.add_geojson(url, name="countries")
self.add_layer_control()
self
self = geonexus.Map(center=[17.6078, 8.0817], zoom=6)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
self.add_geojson(url, name="countries")
self.add_layer_control()
self
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Importing a geojson file and specify the default map center (World) and zoom level.
InĀ [5]:
Copied!
self = geonexus.Map(center=[20, 0], zoom=2)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
self.add_geojson(url, name="countries")
self.add_layer_control()
self
self = geonexus.Map(center=[20, 0], zoom=2)
url = "https://github.com/opengeos/datasets/releases/download/world/continents.geojson"
self.add_geojson(url, name="countries")
self.add_layer_control()
self
Out[5]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Adding Split Map to the map.
InĀ [6]:
Copied!
m = geonexus.Map()
m.add_split_map()
m.add_layer_control()
m
m = geonexus.Map()
m.add_split_map()
m.add_layer_control()
m
Out[6]:
Make this Notebook Trusted to load map: File -> Trust Notebook