К основному содержанию
плагин

geosql — плагин для Claude Code: SQL и установка

Плагин помогает писать и проверять геопространственный SQL для BigQuery, Snowflake и других хранилищ. Нужен для анализа данных с картой.

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add anthropics/claude-plugins-community
/plugin install geosql@claude-community
Открыть на GitHub

Что делает geosql

geosql сначала изучает метаданные хранилища: таблицы, столбцы и типы. Затем агент пишет пространственный SQL с функциями вроде ST_INTERSECTS, ST_DISTANCE, H3 и фильтрами по bbox. Поддерживаются частные таблицы в PostGIS, BigQuery, Snowflake и Wherobots, а также Overture Maps shares в BigQuery и Snowflake.

Для BigQuery каждый запрос проходит dry-run с оценкой объёма данных; по умолчанию действует лимит 10 GiB. Превышающие его запросы переписываются с более узким bbox, другой детализацией H3 или дополнительными фильтрами. Агент также проверяет площадь полигонов или длину линий и при наличии Dekart строит карту для проверки геометрии.

Аутентификация берётся из локальных CLI bq, snow и dekart, поэтому учётные данные хранилища агенту не передаются. Для установки через Claude Code добавьте маркетплейс и установите плагин.

Какие задачи решает

  • исследовать схему геоданных перед написанием SQL
  • ограничить стоимость запроса в BigQuery
  • проверить площадь полигонов или длину линий
  • найти ошибки геометрии на интерактивной карте
  • сопоставить объекты по расстоянию и пересечению

Примеры запросов агенту

  • Покажи плотность зарядных станций вдоль крупных дорог и создай карту через /geosql.
  • Найди в Seattle лучшие места для Sporting Goods Store по соседним объектам и расстоянию до конкурента через /geosql.
  • Проверь доступность школ для зданий в Ottawa и отрисуй результат на карте через /geosql.

Как установить geosql

Через маркетплейс плагинов

/plugin marketplace add anthropics/claude-plugins-community
/plugin install geosql@claude-community

По шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой

Вопросы о geosql

Как установить geosql в Claude Code?

Выполните /plugin marketplace add anthropics/claude-plugins-community и затем /plugin install geosql@claude-community.

Что делает geosql?

Плагин исследует схему хранилища, пишет пространственный SQL, проверяет стоимость и результаты, а при наличии Dekart визуализирует геометрию на карте.

Какие хранилища поддерживает geosql?

Он работает с частными таблицами в PostGIS, BigQuery, Snowflake и Wherobots. Overture Maps shares доступны через BigQuery и Snowflake.

Исходный текст

SKILL.md · MIT
# GeoSQL

Claude Code, Codex, GitHub Copilot, OpenCode, and Mistral Vibe 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](assets/geosqldemo.gif)

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

![Agent with maps loop, 4x performance](assets/agent-with-maps-4x.png)

## Quick Start

With Python (interactive mode):

```bash
pip install geosql && geosql
```

GeoSQL first installs the skill into your detected agent. It then checks whether the optional Dekart CLI is ready and, only when needed, asks before installing or initializing it. The prompt shows the exact commands and defaults to the recommended install option.

After installing, prompt your agent like this:

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

## How to update

Upgrade GeoSQL in the Python environment where it is installed:

```bash
pip install --upgrade geosql
```

If you use the optional Dekart CLI, update it too:

```bash
pip install --upgrade dekart
```

Then rerun the installer so the latest GeoSQL skill and references are copied
to your detected agent:

```bash
geosql
```

## Version telemetry

GeoSQL sends a best-effort version check with its package version and an opaque random installation ID. GeoSQL and Dekart CLI share the ID at `${XDG_CONFIG_HOME:-~/.config}/dekart/installation_id`; deleting that file resets it. Set `DO_NOT_TRACK=1` (or `DNT=1`) to disable the version check before an ID is created. CI sends a reserved non-persisted test ID.

## 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.
```

## How it works

GeoSQL runs an agent loop with a map in it.

![How GeoSQL connects the agent, Dekart CLI, data sources, and deployment](assets/how-geosql-works.png)

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.

## Benchmarks

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:

```bash
python evals/run.py
```

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

© dekart-xyz · MIT · dekart-xyz/geosql

Похожие плагины

Все плагины по теме «Данные и базы» →
firebase официальный Google Подключает Firebase к Claude через MCP: агент работает с Firestore, аутентификацией, облачными функциями, hosting и storage прямо из проекта. ★ 44 635звёзд репо power-platform-architect официальный Tim Hanewich Разбирает требования и стенограммы встреч, предлагая архитектуру Power Platform. Пригодится, когда нужно выбрать компоненты и описать поток данных. ★ 40 418звёзд репо power-bi-development официальный Awesome Copilot Community Плагин помогает разбирать DAX, проектировать модели данных и искать причины проблем с производительностью Power BI. Подойдёт для работы над моделями и отчётами. ★ 40 418звёзд репо partners официальный Awesome Copilot Community Набор партнерских субагентов для миграций в Neon, переноса кода на Arm, развертывания Terraform и расследования инцидентов. ★ 40 418звёзд репо oracle-to-postgres-migration-expert официальный Awesome Copilot Community Переводит data access слой .NET-решений и хранимые процедуры с Oracle на PostgreSQL. Пригодится при поэтапной миграции проектов на Npgsql с верификацией тестами. ★ 40 418звёзд репо openapi-to-application-csharp-dotnet официальный Awesome Copilot Community Создаёт .NET-приложение по спецификации OpenAPI. Подойдёт, когда нужно получить основу ASP.NET Core проекта с контроллерами. ★ 40 418звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой