spatialite

spatialite is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 115 tokens per session (4,628 once invoked), scanned B, original, MIT.

A spatial extension for SQLite, the small database that stores data in one file. It adds shapes, location-based indexes, coordinate conversion, and SQL tests for relationships between geographic objects.

In plain words
What is it for?
Use it to store and query points, lines, and areas, transform coordinates, create spatial indexes, import Shapefiles, and read or write GeoPackage files.
Why use it?
It provides many database features for geographic data without running a separate database server. It is useful for embedded applications, desktop tools, and portable or read-only datasets.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to store and query points, lines, and areas, transform coordinates, create spatial indexes, import Shapefiles, and read or write GeoPackage files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/spatialite
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill spatialite
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spatialite

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/spatialite/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/spatialite)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/spatialite"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/spatialite/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spatialite

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/spatialite"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/spatialite.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,628 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00115 $0.04628
Opus 5.5 $0.00046 $0.01851
Sonnet 5.5 $0.00023 $0.00926
Haiku 4.5 $0.00012 $0.00463

Measured 2d ago against content hash 2ae64fb306f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

spatialite scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo apt install libsqlite3-mod-spatialite

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -LO https://www.gaia-gis.it/gaia-sins/libspatialite-5.1.0-RC0.tar.gz
gis/spatialite/SKILL.md · 366 lines

How it starts

The opening of the file, as written. The whole thing — 366 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://www.gaia-gis.it/fossil/libspatialite/index

官方文档: https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html

当前版本: libspatialite 5.1.0(2023-08-04);spatialite-tools 5.1.0a(2023-08-13),截至 2026-10 仍为最新

安装包: Debian/Ubuntu libsqlite3-mod-spatialite 5.1.0-3、spatialite-bin 5.1.0a-2;conda-forge libspatialite 5.1.0

许可证: MPL-1.1 / GPL-2.0+ / LGPL-2.1+ 三许可(libspatialite);spatialite-tools 为 GPL-3.0+

概述

SpatiaLite 是 SQLite 的空间扩展库。它把完整的空间 SQL 能力加进 SQLite:几何类型、空间索引、坐标转换与 OGC 关系谓词,而数据库仍然是单个普通文件,不需要任何服务端进程。官方把它定位为"SQLite 上的 PostGIS 替代品",适合嵌入式、桌面应用与只读发布场景。

核心组件:

  • libspatialite:扩展库本体,以 mod_spatialite 模块形式加载进 SQLite,提供 SQL 函数
  • spatialite-tools:命令行工具集(spatialite shell、spatialite_tool 导入导出等)
  • 元数据表:geometry_columns 与 spatial_ref_sys,由 InitSpatialMetaData 创建
  • RTree 空间索引:CreateSpatialIndex 建立并与主表触发器保持同步
  • GPKG 兼容:同一套函数能读写 OGC GeoPackage

与 GeoPackage 的关系: GeoPackage 是 SQLite 表格结构的标准封装;SpatiaLite 是功能更全的扩展实现。要跨工具交换数据时优先 GPKG,要完整空间 SQL 能力时用 SpatiaLite。

环境准备

方式一:系统包(Debian / Ubuntu)

# 扩展模块(Python 与 sqlite3 CLI 都用它)
sudo apt install libsqlite3-mod-spatialite

# 命令行工具(spatialite shell、spatialite_tool 等)
sudo apt install spatialite-bin

# 开发头文件(自己编译或链接 libspatialite 时需要)
sudo apt install libspatialite-dev

Debian trixie 上的版本为 5.1.0,与上游一致;更老的发行版(如 bookworm 的 5.0.1)会落后一个小版本。

方式二:conda / mamba

conda install -c conda-forge libspatialite

conda-forge 的 libspatialite 为 5.1.0,Windows / macOS / Linux 均有构建,是跨平台最省事的方式。

方式三:Windows 预编译包

官方站点提供 Windows 二进制(mod_spatialite-x.y.z-win-x86_64.zip 一类命名),解压后把目录加入 PATH,或把 mod_spatialite.dll 放到与 sqlite3.exe 同级的目录。用 conda 装则无需手工放置 DLL。

方式四:源码编译

curl -LO https://www.gaia-gis.it/gaia-sins/libspatialite-5.1.0-RC0.tar.gz
tar xzf libspatialite-5.1.0-RC0.tar.gz
cd libspatialite-5.1.0
./configure --disable-rttopo      # 按需启用 GEOS/PROJ/RTTOPO 等依赖
make -j"$(nproc)"
sudo make install
sudo ldconfig

Read the full file on GitHub · 366 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 366 lines · 115 tokens per session scan B 2ae64fb306f6

Subscribe to this mod's changes

spatialite is a skill published in the GitHub repository znlgis/opengis-skills (76 stars, last pushed 2d ago), licensed MIT. It adds 115 tokens to every session and 4,628 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-28.