Reliable spatial analysis in GIScience requires preserving coordinate semantics, topology, units, and geographic plausibility. Current LLM-based GIS systems generate fluent scripts but rarely enforce these geographic rules at scale. We present GeoContra, a verification and repair framework for LLM-driven Python GIS workflows. It represents each task as an executable geospatial contract-including natural-language questions, schemas, CRS metadata, expected outputs, spatial predicates, topology, metrics, required operations, and forbidden shortcuts. Generated programs undergo static rule inspection, runtime validation, and semantic verification, with violations fed back into a bounded repair loop. Evaluated on 7,079 real geospatial tasks across 15 Boston-area zones, 9 task families, and 11 open-source models (600 runs each), GeoContra improves spatial correctness on closed models from 47.6% to 77.5% for DeepSeek-V4 and from 57.7% to 81.5% for Kimi-K2.5. Across 11 open models, average correctness rises by 26.6%. GeoContra turns fluent code production into verifiable spatial analysis, catching negative travel times, CRS/field-schema violations, missing predicates, and brittle output casts that otherwise yield executable but geographically invalid results.


翻译:GIScience中可靠的空间分析要求保持坐标语义、拓扑结构、单位一致性及地理合理性。当前基于LLM的GIS系统虽能生成流畅脚本,但很少在规模层面强制实施这些地理规则。我们提出GeoContra——面向LLM驱动的Python GIS工作流的验证与修复框架。它将每个任务表示为可执行的地理空间合约,包括自然语言问题、模式描述、CRS元数据、预期输出、空间谓词、拓扑结构、度量指标、所需操作及禁止使用的捷径。生成的程序需通过静态规则检查、运行时验证和语义验证,违规信息将被反馈至受限修复循环中。在波士顿地区15个分区的7,079个真实地理空间任务、9个任务簇及11个开源模型(每个模型运行600次)上的评估表明:GeoContra将闭源模型的空间正确率从47.6%提升至77.5%(DeepSeek-V4),从57.7%提升至81.5%(Kimi-K2.5);11个开源模型的平均正确率提升26.6%。GeoContra将流畅的代码生成转化为可验证的空间分析,成功捕获负旅行时间、CRS/字段模式违反、缺失谓词及脆弱输出类型转换等——这些错误通常会导致程序虽可执行却生成地理无效的结果。

0
下载
关闭预览

相关内容

【SIGMOD2023】大规模地理空间分析:问题、挑战与机遇,
专知会员服务
20+阅读 · 2023年7月9日
【经典书】Python地理信息数据分析,362页pdf
专知会员服务
90+阅读 · 2022年7月4日
Python地理数据处理,362页pdf,Geoprocessing with Python
专知会员服务
116+阅读 · 2020年5月24日
Elasticsearch地理信息存储及查询之Geo_Point
Analysys易观
13+阅读 · 2018年12月29日
GIS最新热点以及未来发展热门
人工智能学家
10+阅读 · 2018年3月29日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
8+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关VIP内容
【SIGMOD2023】大规模地理空间分析:问题、挑战与机遇,
专知会员服务
20+阅读 · 2023年7月9日
【经典书】Python地理信息数据分析,362页pdf
专知会员服务
90+阅读 · 2022年7月4日
Python地理数据处理,362页pdf,Geoprocessing with Python
专知会员服务
116+阅读 · 2020年5月24日
相关基金
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员