File size: 10,307 Bytes
e35c61e
203856c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56415dd
203856c
 
 
56415dd
203856c
 
 
56415dd
e35c61e
 
203856c
ed9fa00
203856c
ed9fa00
203856c
ed9fa00
203856c
ed9fa00
a417613
 
203856c
ed9fa00
203856c
e35c61e
203856c
ed9fa00
203856c
ed9fa00
203856c
 
 
 
 
 
ed9fa00
56415dd
25c46b8
203856c
25c46b8
203856c
 
 
 
 
 
 
 
 
 
 
e35c61e
203856c
e35c61e
ade2b92
e35c61e
203856c
e35c61e
203856c
 
 
 
 
 
 
ed9fa00
 
203856c
e35c61e
203856c
 
 
e35c61e
203856c
e35c61e
203856c
 
 
 
 
e35c61e
 
a417613
e35c61e
203856c
e35c61e
203856c
e35c61e
203856c
e35c61e
203856c
 
 
 
e35c61e
203856c
e35c61e
203856c
 
e35c61e
203856c
e35c61e
203856c
e35c61e
203856c
 
 
 
 
 
 
e35c61e
 
203856c
 
 
 
 
 
 
e35c61e
 
203856c
ed9fa00
203856c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
pretty_name: "GS-QA2: Question Answering over Raster–Vector Geospatial Data"
license: odbl
language:
- en
task_categories:
- question-answering
- text-generation
tags:
- geospatial
- gis
- spatial-reasoning
- text-to-sql
- openstreetmap
- digital-elevation-model
- raster
- vector
- benchmark
- postgis
size_categories:
- 1K<n<10K
configs:
- config_name: vector
  data_files:
  - split: test
    path: data/vector-*.parquet
- config_name: raster_only
  default: true
  data_files:
  - split: test
    path: data/raster_only.parquet
- config_name: raster_vector
  data_files:
  - split: test
    path: data/raster_vector.parquet
- config_name: extended
  data_files:
  - split: test
    path: data/extended.parquet
---

# GS-QA2: A Benchmark for Question Answering over Raster–Vector Data

GS-QA2 is a benchmark for **geospatial question answering over both vector and raster data**. It extends [GS-QA](https://arxiv.org/abs/2605.22811) — a vector-only benchmark built on OpenStreetMap features in a PostGIS database — with a U.S. Digital Elevation Model (DEM) raster layer and 25 new question templates that require terrain reasoning: elevation lookups, slope, aspect, ruggedness, and questions that combine vector filtering with raster analysis.

Each record pairs a natural-language question with an **executable PostGIS SQL query** and its **ground-truth answer**, so every question is verifiable without manual annotation. This release contains the complete benchmark: the **2,800 vector-only pairs** (V1–V28, 100 per template) inherited from [GS-QA](https://arxiv.org/abs/2605.22811) by Saeedan, Rashid, Eldawy, and Hristidis, plus the **500 raster-related pairs** (25 templates × 20 questions) that GS-QA2 adds — **3,300 questions in total**.

Code, ingestion scripts, generation pipeline, and baseline implementations live in the companion repository: **https://github.com/ZhuochengShang/QARV**

**GS-QA2 resources:** [all resources collection](https://huggingface.co/collections/Zoe/gs-qa2-benchmark-source-data-and-leaderboard-6a6c3dea8679f0e932cdead9) · [raw OSM + DEM source data](https://huggingface.co/datasets/Zoe/GS-QA2-source) · [public leaderboard](https://huggingface.co/spaces/Zoe/GS-QA-Leaderboard) · [code](https://github.com/ZhuochengShang/QARV)

## Why this benchmark

Existing geospatial QA benchmarks evaluate vector data only (points, lines, polygons), while vision-oriented raster benchmarks target perception over imagery rather than structured reasoning over raster values. GS-QA2 fills the gap: it measures whether LLM-based systems (Text2SQL, RAG, multi-stage SQL agents, code-writing GIS agents) can reason over continuous terrain surfaces and their interaction with discrete vector features. In the paper's evaluation, systems answered simple point-elevation queries reasonably well but accuracy dropped sharply on terrain derivatives (slope, aspect) and combined raster–vector operations — zonal and global raster operations collapsed to near zero for every baseline.

## Dataset structure

Four configurations, mirroring the paper's template groups of increasing raster-reasoning complexity:

| Config | Templates | Records | Description |
|---|---|---|---|
| `vector` | V1–V28 | 2,800 | Vector-only questions from the original GS-QA benchmark — range, nearest-neighbor, direction, towards, and intersects queries over OSM features, with entity-name, location, direction, count, distance, area, and length answers |
| `raster_only` | R1–R11 | 220 | Direct DEM queries — elevation, slope, aspect, ruggedness, elevation thresholds — anchored at POIs and roads |
| `raster_vector` | VR9–VR14 | 120 | New raster–vector templates requiring tight interaction: zonal aggregation, comparison, and ranking of POIs by terrain properties |
| `extended` | VR1–VR8 | 160 | Standard vector queries augmented with a terrain condition or terrain output (e.g., range queries with elevation filters) |

All 3,300 questions form a single evaluation set, published as the `test` split of each config. All configs are stored as zstd-compressed Parquet. Questions were instantiated from templates by sampling real geographic entities (POIs, roads, parks, regions across the contiguous United States), executing the paired SQL against the reference PostGIS database (OSM + 30 m DEM, 265,950 raster tiles), and retaining only questions with valid, non-empty ground truth.

### Data fields

| Field | Type | Description |
|---|---|---|
| `id` | string | Unique ID: `{group}/{template}/{index}` |
| `template_id` | string | Paper template ID: `V1``V28` (vector), `R1``R11` (raster-only), `VR1``VR8` (extended), `VR9``VR14` (raster–vector) |
| `group` | string | `vector`, `raster_only`, `raster_vector`, or `extended` |
| `template` | string | Template file name, e.g. `elevation+poi`, `slope+route`, `range+name+elevation_condition` |
| `question` | string | Natural-language question |
| `sql` | string | Executable PostGIS SQL query that produces the ground truth |
| `answer_type` | string | Expected output type, e.g. `elevation - point based`, `slope`, `entity name` |
| `answers` | string (JSON) | Ground-truth answer rows as a JSON-encoded list of objects. Keys vary by template (`elevation`, `slope_degrees`, `poi_name`, `distance_m`, …), so the list is serialized as a JSON string — parse with `json.loads` |
| `question_entities` | string (JSON) | JSON-encoded metadata for the entities used to instantiate the template: display name, category, WKT geometry, and full OSM attributes |

**Answer schema in the `vector` config** (from the original GS-QA documentation): for entity-name templates (V1–V11 except V7) the answer attribute ends with the suffix `_name` (e.g. `poi_name`); for the multi-hop template V7 it is `multihop_answer` (with its type in `multihop_attribute`); for location templates (V12–V20) it is `geometry` (WKT — geocode it if evaluating against addresses rather than coordinates); for direction templates (V21–V22) it is `angle`; and for the remaining numeric templates it is `count`, `distance`, `length`, or `area`. For non-aggregate answers the full database record is stored alongside the answer attribute.

The untouched original template files (one JSONL per template, including 9 exploratory templates outside the canonical 500-question evaluation set) are available in the [QARV repository](https://github.com/ZhuochengShang/QARV) under `GS-QA/benchmark/qa2/`.

### Example record (`raster_only`, template `elevation+poi`)

```json
{
  "question": "What is the elevation at Cousins Subs, Chicago, IL?",
  "sql": "SELECT ST_Value(rast, 1, ST_GeomFromText('POINT (-87.631702 41.88228)',4326)) AS elevation FROM public.dem_us WHERE ST_Intersects(rast, ST_GeomFromText('POINT (-87.631702 41.88228)',4326)) LIMIT 1;",
  "answers": [{"elevation": 286.0}],
  "answer_type": "elevation - point based"
}
```

## Usage

```python
import json
from datasets import load_dataset

ds = load_dataset("Zoe/GS-QA2", "raster_only", split="test")

example = ds[0]
print(example["question"])
print(example["sql"])
answers = json.loads(example["answers"])        # list of ground-truth rows
entities = json.loads(example["question_entities"])
```

To *execute* the SQL and reproduce ground truths or run the baselines, you need the reference PostGIS database (OSM vector tables + DEM raster tiles). Raw OSM extracts and DEM files are published separately in [Zoe/GS-QA2-source](https://huggingface.co/datasets/Zoe/GS-QA2-source); use them with the ingestion instructions in the [QARV repository](https://github.com/ZhuochengShang/QARV) (`GS-QA/ingestion/`).

## Evaluation

Answers are scored per output type, following the paper (Tables 9–10): token-level F1 ≥ 0.8 for entity names, geodesic distance error ≤ 5 m for locations, circular angular error ≤ 5° for directions and aspect, absolute error ≤ 10 m for elevations, ≤ 5° for slope, and relative error ≤ 0.05 for areas, lengths, distances, and counts. Compound outputs are correct only when every component passes. Evaluation scripts are in `GS-QA/baselines/evaluation/` of the companion repository.

## Benchmark construction

1. **Template selection** — 25 raster-related templates organized by Tomlin's map-algebra operation types (local, focal, zonal, global) plus spatial predicates (range, nearest neighbor, intersects, …).
2. **Parameter sampling** — placeholders (`[ANCH_POI]`, `[DISTANCE]`, `[ELEV_COND]`, …) filled with real entities and values sampled from the database.
3. **NL generation** — natural-language phrasing with grammar correction; duplicates removed via canonicalized SQL comparison.
4. **Ground-truth execution** — each paired SQL runs against the PostGIS reference database (120 s timeout); empty/invalid results are discarded and regenerated. 20 questions are kept per template.

## Source data and licensing

- **Vector features:** © [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors, available under the [Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/). Question text, entity metadata, and ground-truth answers are derived from OSM data, so this dataset is shared under ODbL.
- **Terrain:** elevation values derive from the [ASTER Global Digital Elevation Model V3 (ASTGTM v003)](https://doi.org/10.5067/ASTER/ASTGTM.003), 1 arc-second (≈ 30 m) resolution over the contiguous United States. ASTER GDEM is a product of METI and NASA.

## Citation

If you use the `vector` config (V1–V28), please also cite the original GS-QA benchmark:

```bibtex
@article{saeedan2026gsqa,
  title   = {GS-QA: A Benchmark for Geospatial Question Answering},
  author  = {Saeedan, Majid and Shihab Rashid, Muhammad and Eldawy, Ahmed and Hristidis, Vagelis},
  journal = {arXiv preprint arXiv:2605.22811},
  year    = {2026}
}
```

```bibtex
@inproceedings{shang2026gsqa2,
  title     = {GS-QA2: A Benchmark for Question Answering over Raster--Vector Data},
  author    = {Shang, Zhuocheng and Elmahallawy, Shahd and Al Nazi, Zabir and Hristidis, Vagelis and Eldawy, Ahmed},
  year      = {2026},
  note      = {Benchmark and code: https://github.com/ZhuochengShang/QARV}
}
```

## Contact

Zhuocheng Shang — zshan011@ucr.edu — University of California, Riverside