Skip to main content

Install GeoSQL instructions into local AI CLIs.

Project description

geosql

Claude/Codex geospatial SQL skill for data scientists and analysts working with geospatial data on BigQuery and Snowflake.

GeoSQL demo

Describe what you want geographically, and skill writes and runs SQL against free map datasets (Overture Maps) in BigQuery or Snowflake, checks the cost, validates the answer, and (if you ask) shows you the map — without surprise bills or hand-waved results.

Example questions it handles well:

  • "Show me all bike lanes in Amsterdam"
  • "How many buildings are in downtown Tokyo?"
  • "Map the rail network in Germany"
  • "Aggregate restaurant density in NYC by H3 cell"

It works with any private GEOGRAPHY/GEOMETRY dataset too.

Install (Claude/Codex)

In Claude Code (recommended):

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

With Python (interactive mode):

pip install geosql
geosql

With Node.js:

npx skills add dekart-xyz/geosql

Then type /geosql in your agent's prompt to use the skill.

Connect to your warehouse

GeoSQL can use you data warehouse if data if you have bq or snow CLI installed and authenticated with default project/connection (!) configured.

Enable map rendering (recommended)

pip install dekart
dekart init

Feature List

🗺️ Data discovery

  • Auto-explores warehouse metadata (tables, columns, types) instead of guessing.
  • Works with BigQuery (bigquery-public-data.overture_maps) and Snowflake (OVERTURE_MAPS__* marketplace shares).

💸 Cost safety

  • Always dry-runs BigQuery queries first to estimate bytes scanned.
  • Enforces a 10 GiB billing cap by default (--maximum_bytes_billed).
  • Refuses to execute over-budget queries — rewrites them cheaper instead (tighter bbox, lower H3 resolution, more filters).
  • Uses the bbox overlap pattern (not containment) for fast partition pruning, then ST_INTERSECTS for geographic correctness.

✅ Mandatory validation

Before showing you a final query, it:

  1. Dry-runs for cost.
  2. Runs COUNT(*) to confirm rows exist and are reasonable.
  3. Computes total area (polygons) or total length (lines) as a sanity check.
  4. Cross-checks numbers against domain knowledge — debugs if something looks off.

🔷 H3 spatial aggregation

  • Built-in support for hexagonal grid rollups (heatmaps, density).
  • Region-aware namespaces (jslibs.h3.* for US, jslibs.eu_h3.* for EU).
  • Cost rules: filter first, aggregate before adding heavy boundary geometry.

🗺️ Map rendering

  • Uses the dekart CLI to turn results into an interactive map.
  • Workflow: create report → dataset → upload CSV → snapshot → inspect.
  • Only triggers when you explicitly say "map" — never auto-renders.
  • Smart styling rules: picks layer type by question (Points for positions, H3 for density, Arcs for origin-destination, etc.), uses appropriate palettes, locks zoom to the insight.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geosql-0.16.0.tar.gz (5.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geosql-0.16.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file geosql-0.16.0.tar.gz.

File metadata

  • Download URL: geosql-0.16.0.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for geosql-0.16.0.tar.gz
Algorithm Hash digest
SHA256 e48a0a57963d22f7048cffc857254f375a6b18ce34e143f1124cfc45b3719f2a
MD5 16dbb9490e93a49159ad3ed542643cd7
BLAKE2b-256 85b016dddfcb72e8d9d364747ae5c57cf4888b9cd29b322082a8a75f9e42e361

See more details on using hashes here.

File details

Details for the file geosql-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: geosql-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for geosql-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 592db75247a20b5b8a2b515c93ac5df0dde28dc66ccec6a49ec3b3f0300b9343
MD5 b21888eb487d7b6e483d943f0dce4284
BLAKE2b-256 d68a74cb8a1ba4dfbc242fa867d7f61caceb11ff0ccfbd8b4fca75e9be2677c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page