Abstract
MapBot is an interactive, Large Language Model (LLM)-powered agent designed to simplify geospatial analysis for non-experts. By orchestrating state-of-the-art vision models, such as the Segment Anything Model (SAM) and DinoV2, through a Python-based execution loop, MapBot allows users to annotate and query satellite imagery using natural language and simple point-and-click interactions. This system transforms complex Geographic Information Systems (GIS) tasks into a conversational, web-based experience, effectively bridging the gap between advanced AI foundation models and practical geospatial applications.
Introduction
Geospatial data is a cornerstone of modern urban planning, environmental monitoring, and precision agriculture. However, the specialized software required to analyze this data—Geographic Information Systems (GIS)—typically involves a steep learning curve and high-performance hardware. This creates a significant barrier for journalists, NGOs, and researchers in non-technical fields who could benefit from spatial insights.
While recent advancements in AI have produced powerful "foundation models" for computer vision, these models often remain siloed and difficult to integrate into standard workflows. MapBot addresses this challenge by creating an "agentic" system: a tool that does not merely display data but actively "thinks," generates code, and executes complex tasks based on high-level human instructions.
Methods
MapBot’s architecture is centered around a Read-Eval-Print Loop (REPL) powered by a frontier LLM, specifically GPT-4. The system operates through several integrated layers that allow it to translate user intent into spatial operations.
The Agent Loop and Execution Environment
When a user provides a prompt or interacts with the map, the LLM generates "internal thoughts" to plan its approach and then writes Python code to execute that plan. This code is run in a sandboxed Python environment equipped with standard geospatial libraries such as GeoPandas and Rasterio. This approach makes the system extensible by design; new capabilities can be added simply by providing the agent with access to new Python functions.
Vision Foundation Models
To interpret visual data, the agent leverages two primary vision models:
- Segment Anything Model (SAM): Used for generating precise object masks from user clicks or bounding boxes.
- DinoV2: Employed for extracting rich visual features, enabling the system to identify objects based on visual similarity (e.g., "find all objects that look like this rooftop").
System Implementation
The MapBot interface is designed for accessibility, utilizing a bidirectional feedback loop between the user and the agent.
Web Interface and Data Integration
Built with Streamlit and MapBox JS, the interface treats map visualization as a "side effect" of code execution. When the LLM updates a GeoDataFrame (a spatial data structure), the web interface automatically reflects these changes on the map. This allows for a seamless interaction where users can see the results of their queries in real-time.
MapBot is data-agnostic, supporting user-provided GeoTIFF imagery as well as external data from APIs like Mapillary, Mapbox, and OpenStreetMap. By leveraging the pre-training of GPT-4 and vision models, MapBot achieves "zero-to-one shot" performance, meaning it can analyze new, unseen imagery without requiring task-specific training data.
Results and Discussion
As a system demonstration, MapBot showcases the potential of LLMs to democratize complex technical workflows. Key qualitative results include:
- Natural Language Querying: The system successfully processes complex spatial logic, such as "Identify trees within 20 meters of a utility pole," by translating the request into a series of spatial joins and filters.
- Interactive Annotation: Users can define a class, provide a few examples via clicks, and trigger the system to run inference across high-resolution raster images.
- Unified Data Workflows: By fusing spatial information with model outputs into a unified GeoDataFrame, MapBot allows for standard data science operations to be performed directly within a map-based tool.
Limitations and Future Work
While MapBot demonstrates a powerful new paradigm for GIS, several challenges remain. Currently, the system is limited by the size of imagery that can be processed locally or via API. Future iterations aim to integrate with cloud-native resources like Google Earth Engine or Microsoft Planetary Computer to handle planetary-scale data. Additionally, the authors envision a "plugin marketplace" where researchers can contribute domain-specific modules for specialized tasks like flood risk assessment or forest cover monitoring. Systematic usability studies are also planned to quantify the efficiency gains for non-expert users compared to traditional GIS software.
Summary updated