Source-linked AI summary

An Autonomous GIS Agent Framework for Geospatial Data Retrieval

Huan Ning, Zhenlong Li, Temitope Akinboyewa, M. Naser Lessani

arXiv:2407.21024v2cs.IRcs.AIcs.CLcs.ET

TL;DR

Autonomous GIS agents need geospatial data, but general mechanisms for discovering and retrieving it remain limited. This paper presents a handbook-based framework that selects a source and generates, executes, and debugs retrieval programs. The prototype retrieved correct data in 80%–90% of more than 70 request tests and demonstrated retrieval without human intervention.

  • Problem

    General mechanisms for autonomous agents to select appropriate geospatial data sources and retrieve data across their differing technical requirements remain limited.

    Source: §1 · p. 2
  • Method

    The framework uses an LLM to select from a predefined source list and generate, execute, and debug retrieval programs using source-specific handbooks.

    Source: §1 · p. 2, §2.2 · p. 7
  • Results

    80%–90% of more than 70 data-request tests retrieved correct data, and the framework demonstrated retrieval through simple natural-language commands without human intervention.

    Source: §1 · p. 3, §4 · p. 14
  • Takeaways & Limitations

    The framework can provide geospatial data to other agents for further analysis, with new sources added through handbooks and index updates.

    Source: §4 · p. 14

    The current implementation supports only text handbooks and cannot support long handbooks because of LLM prompt-length restrictions.

    Source: §4 · p. 14

Abstract

from arXiv · show

Powered by the emerging large language models (LLMs), autonomous geographic information systems (GIS) agents have the potential to accomplish spatial analyses and cartographic tasks. However, a research gap exists to support fully autonomous GIS agents: how to enable agents to discover and download the necessary data for geospatial analyses. This study proposes an autonomous GIS agent framework capable of retrieving required geospatial data by generating, executing, and debugging programs. The framework utilizes the LLM as the decision-maker, selects the appropriate data source (s) from a pre-defined source list, and fetches the data from the chosen source. Each data source has a handbook that records the metadata and technical details for data retrieval. The proposed framework is designed in a plug-and-play style to ensure flexibility and extensibility. Human users or autonomous data scrawlers can add new data sources by adding new handbooks. We developed a prototype agent based on the framework, released as a QGIS plugin (GeoData Retrieve Agent) and a Python program. Experiment results demonstrate its capability of retrieving data from various sources including OpenStreetMap, administrative boundaries and demographic data from the US Census Bureau, satellite basemaps from ESRI World Imagery, global digital elevation model (DEM) from OpenTopography.org, weather data from a commercial provider, the COVID-19 cases from the NYTimes GitHub. Our study is among the first attempts to develop an autonomous geospatial data retrieval agent.

1 Introduction

Autonomous GIS agents need to retrieve essential geospatial data, but prior work has not provided general mechanisms for doing so. This study proposes a flexible framework and prototype for selecting data sources and fetching data, with retrieval success reported across more than 70 requests.

1 Introduction

  • Prior work demonstrated geospatial queries and fetching from particular sources, but often omitted retrieval implementation details or a general framework.The discussed approaches include OpenStreetMap, Wikidata, and satellite-imagery sources.Source: §1 · p. 2
  • Autonomous geospatial retrieval must discover relevant data, select an appropriate source from natural-language requirements, and handle source-specific technical requirements.Online-source discovery is identified as a challenge distinct from source selection and fetching.Source: §1 · p. 2
  • The proposed framework selects a source and retrieves its data by generating, debugging, and executing programs using source-specific handbooks.The framework targets source selection and fetching; online data-source discovery is left for future research.Source: §1 · p. 2
  • 80%–90% of more than 70 data-request tests retrieved the correct data across six sources.The prototype was released as a QGIS plugin and an interactive Python program.Source: §1 · p. 3

2 Methodology

The methodology starts from a manually assembled list of data sources and handbooks, then automates source selection and data fetching. Its prototype uses an LLM to select sources, generate and debug retrieval code, and offers both QGIS and Python interfaces.

2 Methodology

  • The study manually created a source list and handbooks, focusing automation on choosing from that list and fetching data rather than online source discovery.Human analysts commonly gather candidate sources, select a suitable one, and follow provider-specific technical requirements to retrieve data.Source: §2 · p. 3

2.1 The framework

  • The framework combines a source index for LLM source selection with a handbook inventory containing retrieval instructions, supplemented by authentication and codebase components.Figure 1 presents the framework architecture; humans or other agents can add or update sources in a plug-and-play manner.Source: §2.1 · p. 3, Figure 1 · p. 4

2.1.1 Data source index

  • The brief data source index describes available sources and assigns short aliases as identifiers for use in prompts.The example index includes sources such as OpenStreetMap, US Census data, weather data, ESRI World Imagery, COVID-19 data, and global DEMs.Source: §2.1.1 · pp. 4–5

2.1.2 Handbook inventory

  • Each source-specific handbook supplies retrieval details, while verified code templates and authentication support program generation and access.Handbooks may describe endpoints, formats, attributes, and specialized retrieval methods; the source index and handbook inventory can be modified independently for plug-and-play maintenance.Source: §2.1.2 · p. 5

2.2 The proof-of-concept prototype agent

  • The prototype sends a natural-language request and source index to GPT-4o, retrieves the selected source’s handbook, then generates and executes Python retrieval code.A restricted program structure is used; execution errors trigger self-debugging that resubmits the request, handbook, code, and error for correction, for up to 10 iterations.Source: §2.2 · pp. 6–7
  • The prototype is available as a QGIS plugin for no-code retrieval and a Jupyter Notebook Python program for more flexible customization.The QGIS plugin can load downloaded data into the GIS environment, while the Python program can support customized workflows.Source: §2.2 · pp. 7–8

3 Case Studies

The case studies demonstrate retrieval across six supported data sources and varied geospatial data types, while exposing source-specific constraints such as OSM parsing and Census variable selection.

3 Case Studies

  • The prototype supports six data sources spanning vector, raster, and attribute data, and the authors report more than 70 test cases across varied scenarios.The authors invite readers to explore the cases or test additional requests through the QGIS plugin or Python program.Source: §3 · p. 8

3.1 OpenStreetMap

  • A handbook template substantially improved OSM retrieval despite difficult query generation and relation-to-multipolygon parsing; Nigeria examples include city points, river lines, and state polygons.The displayed data required four individual requests.Source: §3.1 · p. 8, Figure 3 · p. 8

3.2 US Census data

  • The agent retrieved Pennsylvania county boundaries and 2022 population, plus state boundaries and over-25/college-degree populations for 2012 and 2022; variable combinations sometimes missed one sex.For total senior population requests, it could select only male or female population.Source: §3.2 · p. 9, Figure 4 · p. 9, Figure 5 · p. 10

3.3 Satellite imagery

  • ESRI imagery retrieval uses place names or bounding boxes, with Nominatim geocoding place-name boundaries; examples span several geographic extents and resolution levels.Examples include the FAST Telescope, Yellowstone, a bounding-box region, Qingdao, and Nigeria.Source: Figure 3 · p. 8, §3.3 · p. 10, Figure 6 · p. 11

3.4 Digital elevation model (DEM)

  • OpenTopography DEM retrieval supports place names or bounding boxes at 30m and 90m resolution, including Puerto Rico and Chongqing examples with other data displayed alongside.The Puerto Rico example overlays OSM layers and includes a Census population-and-income table; Chongqing’s DEM is displayed as hillshade.Source: §3.4 · p. 11, Figure 7 · p. 12

3.5 Weather data

  • The OpenWeather API returns historical, current, and forecast data by location and period; handbook prompts specify period or current time because GPT-4o cannot determine the time itself.Examples show historical weather for Yulin, China, and current weather for Cairo, Egypt.Source: §3.5 · p. 12, Figure 8 · p. 13, Figure 9 · p. 13

3.6 COVID-19 data

  • Using handbook URLs, data structures, and date ranges, the agent retrieves New York Times cumulative COVID-19 cases by requested geographic level and time period without a formal API.Figure 10 shows county-level cumulative cases from October 2021 to February 2022.Source: §3.6 · p. 13, Figure 10 · p. 14

4 Discussion

The discussion presents LLM-Find as feasible for retrieving geospatial data through natural-language commands without human intervention, while describing its extensibility and limitations in handbook formats, length, and data assessment.

  • LLM-Find demonstrates the feasibility of retrieving geospatial data from natural-language commands without human intervention, providing data to other agents for further analysis.Source: §4 · p. 14
  • Adding a source requires updating the index and creating a handbook without affecting existing sources; shared handbooks may simplify maintenance and support autonomous discovery.Source: §4 · p. 14
  • The current implementation supports only text handbooks, limiting sources whose boundaries are represented by vector files or raster maps, and cannot support long handbooks.Source: §4 · p. 14
  • To address the challenge, handbooks could include all variables and descriptions using large-input LLMs such as Gemini 1.5 (Google, 2024), though computational time and cost may be obstacles, motivating exploration of RAG.Source: §4 · p. 15
  • Dataset suitability assessment remains a needed module: choosing boundary scales or terrain resolution depends on experience and application context, and agent performance against humans remains to be evaluated.Source: §4 · p. 15

5 Conclusion

The conclusion reports a proof-of-concept retrieval agent and emphasizes its extensible design, while identifying autonomous data discovery, assessment, and handbook generation as future research priorities.

  • LLM-Find demonstrated geospatial data retrieval through simple natural-language commands without human intervention, and its plug-and-play design supports adding sources without affecting existing ones.Source: §5 · p. 15
  • The proof-of-concept agent is available as a QGIS plugin and a Python program in Jupyter Notebook; case studies showed it selecting a source, loading its handbook, and generating and executing retrieval code.Source: §5 · p. 15
  • Future research should enhance autonomous online data discovery, assessment, and handbook generation; the Python/Jupyter source, over 70 request examples, and QGIS plugin source are available through GitHub repositories.Source: §5 · p. 15

Appendix 1. An example prompt for selecting the data source

The appendix gives an example prompt for choosing among listed geospatial data sources and retrieving requested data, with rules for source selection and a sample response.

  • The prompt casts the agent as an experienced GIScience programmer expected to select sources and handle downloaded data and its formats, projections, and metadata.Source: Appendix 1. An example prompt for… · p. 17
  • The example task requests all mainland China province boundaries as polygons and specifies GeoPackage output at a named file path.Source: Appendix 1. An example prompt for… · p. 17
  • Selection rules prioritize a source named in the request, direct unspecified administrative-boundary requests to OpenStreetMap and US Census tract or block-group requests to Census, and require an appropriate source or “Unknown” when none fits.Source: Appendix 1. An example prompt for… · p. 17
  • The source list covers OpenStreetMap, US Census boundaries and demographics, New York Times COVID-19 data, OpenWeather, and ESRI World Imagery, with their offered data types and some coverage or forecast limits.Source: Appendix 1. An example prompt for… · p. 17
  • The reply example selects OpenStreetMap for a request to obtain US state administrative boundaries from that source.Source: Appendix 1. An example prompt for… · p. 17

Appendix 2. An example prompt for fetching administrative boundary data

The example prompt assigns a GIS coding role, specifies a China-province boundary download, and gives source-selection and runnable-code instructions.

  • The task is to download all mainland China province boundaries as polygons and save them in GeoPackage format at the specified path.The requested path is E:\\dwonloaded_data.gpkg.Source: Appendix 2. An example prompt for… · p. 17
  • The handbook distinguishes boundary lookup rules: English place names require a name:en filter, while OSMnx is presented as a fast option for one place boundary.For Overpass relation queries, the prompt requires geometry output and recommends GeoPandas for creating vectors.Source: Appendix 2. An example prompt for… · p. 18
  • For multiple administrative boundaries, the prompt recommends Overpass over slow OSMnx and says to set the administrative level carefully.It also directs OSMnx use to place boundaries, while recommending Overpass for POIs and polylines.Source: Appendix 2. An example prompt for… · p. 18
  • The generated download code must be in download_data(), be directly executable, and raise an error if downloading fails.The prompt asks for Python code to be returned in a Python code block; GeoPackage is the default when no format is specified.Source: Appendix 2. An example prompt for… · p. 18
  • The reference code iterates relation members, forms outer polygons from member ways, and subtracts polygons formed from inner lines when present.It appends the resulting polygon geometry for each province.Source: Appendix 2. An example prompt for… · p. 19
  • The example preserves downloaded attributes and writes the boundary layer to GeoPackage.The prompt also advises retaining attributes such as place name, street name, road type, and level.Source: Appendix 2. An example prompt for… · pp. 18, 20
Loading 2407.21024v2…