Geosql:一种用于地理空间数据的 Claude/Codex 技能
Geosql: A Claude/Codex skill for geospatial data

原始链接: https://github.com/dekart-xyz/geosql

**GeoSQL** 是一款开源工具,旨在增强 AI 智能体(Claude、Codex、GitHub Copilot)在 PostGIS、BigQuery、Snowflake 和 Wherobots 上的地理空间数据分析能力。通过集成“地图闭环”(map-in-the-loop)反馈机制,其任务准确率比纯文本分析提升了 4 倍。 **主要功能包括:** * **智能体集成:** 可通过 CLI 轻松安装,或作为 Claude Code 和 VS Code 的插件使用。 * **高级功能:** 自动发现数据仓库元数据,编写特定引擎的空间 SQL(如 H3、ST_INTERSECTS),并执行几何图形验证。 * **效率与安全:** 包含成本估算防护机制(如 BigQuery 账单上限),并强制对高昂任务进行查询重写。 * **视觉自校正:** 配合开源 **Dekart** 平台使用时,智能体可渲染地图,从而识别并纠正文本模型常忽略的空间错误(如坐标不匹配或错误的连接)。 * **隐私优先:** 在本地或自托管环境中运行,利用现有的 CLI 凭证,确保敏感数据不会离开您的基础设施。 无论是进行选址、房地产分析还是基础设施规划,GeoSQL 都能让智能体以视觉方式迭代空间逻辑,确保结果精准且经过验证。

Hacker News最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交登录Geosql:一种用于地理空间数据的Claude/Codex技能 (github.com/dekart-xyz)由 rzk 于 1 小时前发布,9 点 | 隐藏 | 过往 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Claude, Codex, and GitHub Copilot skill for data scientists and analysts working with geospatial data on PostGIS, BigQuery, Snowflake, and Wherobots.

Note: No SaaS account needed. Works 100% locally or self-hosted.

GeoSQL demo

4x improvement on geospatial tasks with map in the loop.

Agent with maps loop, 4x performance

With Python (interactive mode):

pip install geosql && geosql

Install directly into a supported agent:

geosql install claude
geosql install codex
geosql install copilot

Or in Claude Code:

/plugin marketplace add dekart-xyz/geosql
/plugin install geosql

After geosql install copilot, use GeoSQL from VS Code Copilot or Copilot CLI with prompts such as:

/geosql Show EV charger density along major roads and render a map

Install Dekart for map rendering and PostGIS support

GeoSQL optionally uses Dekart: an open-source Kepler.gl backend with connectors for PostGIS, BigQuery, and Snowflake. You can run Dekart locally with one docker command, self-host it on your own infrastructure, or use Dekart Cloud.

Run Dekart locally (skip this step to use Dekart Cloud):

docker run -p 8080:8080 dekartxyz/dekart

Install the Dekart CLI:

pip install dekart && dekart init

Follow CLI and dekart prompts to connect your PostGIS, BigQuery, Snowflake or Wherobots database.

Example prompts to try in your agent:

Real estate analysis:

/geosql Show buildings with low school accessibility in Ottawa, render as a map

Site selection:

/geosql Find the top 10 locations for Sporting Goods Store in Seattle based on POI co-location and distance to the nearest competitor. Create a map.

EV charging infrastructure:

/geosql create map EV charger density along major Romanian roads, highlighting how many charging stations are within 5 km of each motorway, trunk, or primary road segment.

GeoSQL runs an agent loop with a map in it.

  1. Discovery. The skill explores your warehouse metadata (tables, columns, types) instead of guessing schemas. Works with Overture Maps shares on BigQuery and Snowflake, and your private tables on PostGIS, BigQuery, Snowflake, or Wherobots.
  2. SQL. The agent writes spatial SQL using the right functions for your engine (ST_INTERSECTS, ST_DISTANCE, H3, bbox overlap for partition pruning, and so on).
  3. Cost check. On BigQuery, every query is dry-run first to estimate bytes scanned. A 10 GiB billing cap is enforced by default. Over-budget queries get rewritten cheaper (tighter bbox, lower H3 resolution, more filters) instead of executed.
  4. Geometry validation. The agent computes total area (polygons) or total length (lines) as a sanity check, and cross-checks against domain knowledge.
  5. Map feedback. When available, the agent renders the result through Dekart, looks at the rendered image, and corrects geometry mistakes the text-only loop would miss. This is the loop that gets the 4x improvement.

The skill uses your local CLI authentication (bq, snow, dekart), so warehouse credentials never go to the agent.

GeoSQL ships with a reproducible eval suite under evals/. Each case asserts specific behaviors (cost guardrails, validation steps, correct result), not just "did the agent answer."

Current results on the included suite:

Case Assertions Pass rate
london-boroughs 4 100%
berlin-create-map 3 100%
paris-boundaries 1 100%
Total 8 100%

Average: 3,085 tokens per turn, 72 s duration per turn.

The 4x improvement chart above compares the same task set with and without the map-in-loop step. Without maps, the agent's text-only validation misses geometry-class errors (mistaking a neighborhood polygon for a metro-area perimeter, double-counting overlapping features, picking the wrong join key on coordinate-reference systems). Adding the rendered map as a tool call lets the agent see those mistakes and self-correct.

Run the suite yourself:

See evals/RUNBOOK.md for setup and how to add new cases. PRs with new evals welcome.

联系我们 contact @ memedata.com