AI agents
AI Agents for Geospatial Analysis and Visualization
Uncomment the following line to install leafmap if needed.
Installation¶
In [ ]:
Copied!
# %pip install "geoai[agents]"
# %pip install "geoai[agents]"
Import libraries¶
In [ ]:
Copied!
from geoai import Map
from geoai.agents import GeoAgent
from geoai import Map
from geoai.agents import GeoAgent
Create an agent with default map¶
In [ ]:
Copied!
agent = GeoAgent()
agent = GeoAgent()
In [ ]:
Copied!
agent.session.m
agent.session.m
In [ ]:
Copied!
agent.ask("Add OpenTopoMap basemap")
agent.ask("Add OpenTopoMap basemap")
In [ ]:
Copied!
agent.ask("Fly to Chicago")
agent.ask("Fly to Chicago")
Create an agent with a custom map¶
In [ ]:
Copied!
custom_map = Map(center=[-83.92, 35.96], zoom=11, projection="globe")
custom_map
custom_map = Map(center=[-83.92, 35.96], zoom=11, projection="globe")
custom_map
In [ ]:
Copied!
agent = GeoAgent(map_instance=custom_map)
agent.ask("Add basemap Esri.WorldImagery")
agent = GeoAgent(map_instance=custom_map)
agent.ask("Add basemap Esri.WorldImagery")
In [ ]:
Copied!
agent.ask("Remove Esri.WorldImagery")
agent.ask("Remove Esri.WorldImagery")
Show the agent UI¶
In [ ]:
Copied!
agent = GeoAgent()
agent.show_ui()
agent = GeoAgent()
agent.show_ui()