spatial-sql
Skill76 starsChanged 45 days agoMITView on GitHub
Write, review, debug or optimize spatial SQL on an already chosen engine, including DuckDB Spatial, PostGIS, BigQuery GIS, Snowflake and Sedona. Use for spatial predicates, joins, indexes, query plans, CRS and metric/geodesic correctness. Route unresolved engine or cross-system architecture choices to open-map-stack; ordinary non-spatial SQL and casual place questions are outside this skill.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- TerraLabAI/geoai-skillstheir own version, first seen Nov 1, 2026
- jaakla/openmapstackword for word, first seen Sep 28, 2026
Other versions2 projects use a version of this.
Word for word · 1
- jaakla/openmapstack★ 76100% same
Edited · 0
None found.
Wrote their own version · 1
- TerraLabAI/geoai-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- neon-ai-gatewaySkill
- neon-authSkill
- neon-functionsSkill
- neon-object-storageSkill
- neon-postgres-branchesSkill
- neon-postgres-egress-optimizerSkill
- neon-postgresSkill
- neonSkill
- geospatial-data-discoverySkill
- open-map-stackSkill
- reproducible-gis-projectSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
When the user has dlt, Dagster, dbt, QGIS or Observable in their stack, read references/established-stack.md for ownership and integration …
- Distinctive: line 43
Run a small meaningful control when an engine is available: qualifying and non-qualifying features, a boundary, and duplicate matches where …
- Very specific: line 62
No project template, worked example or OpenMapStack CLI is needed for a bounded query task.
- Distinctive: line 68
Keep GIS correctness and the task boundaries above when using a companion.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spatial SQL
Solve the query in the engine the user has chosen. Read
references/spatial-sql.md for the relevant engine and query patterns, and
references/formats-and-crs.md when coordinate or format semantics matter.
When the user has dlt, Dagster, dbt, QGIS or Observable in their stack, read
references/established-stack.md for ownership and integration boundaries.
Preserve their chosen tools; retain source pins, GIS correctness and reproducible
evidence. Do not duplicate their SQL, ingestion or scheduler definitions.
Query workflow
- Establish the engine/version, available spatial functions, geometry versus geography types, CRS/SRID, input grain, expected result and scale. Inspect the existing query and plan when available. Do not assume different engines share function signatures, boundary semantics or index behavior.
- Express the intended spatial relationship precisely. Resolve intersects versus contains/covers, boundary inclusion, null/empty/invalid geometries, and whether several spatial matches should duplicate an entity or produce a single membership result.
- Make distance, area and buffers use the intended units and method. A geographic geometry in EPSG:4326 does not acquire metre units from a numeric threshold. Use the engine's explicitly supported geodesic/geography operation, or a projected CRS whose area of use contains the data's known extent. For distance and within-distance tests on an unknown or wide extent, prefer an operation the engine documents as geodesic for the geometry types involved; do not guess a UTM zone or national grid. A geography type does not make every operation geodesic: check buffers and other constructions per operation. Assigning an SRID is not coordinate transformation; Web Mercator is not a general metric-analysis CRS.
- Preserve analytical correctness while improving execution. Consider spatial indexes or candidate filters, predicate pushdown, partition pruning and join cardinality. An expression or cast can prevent use of an existing index; verify the relevant plan instead of promising index use by syntax.
- Run a small meaningful control when an engine is available: qualifying and
non-qualifying features, a boundary, and duplicate matches where relevant.
Report actual execution evidence separately from a reasoned SQL review.
An unavailable engine is
not_testable, not a successful query run.
Return corrected SQL, consequential assumptions and a short explanation of correctness and performance. Do not create a full GIS project for a bounded query review. Preserve source data; an optimization must not silently change the metric, feature population or authoritative geometry.
When the task expands
Engine selection, shared-system design and joint compute/storage/delivery
trade-offs belong with an installed open-map-stack or an explicit architecture
discussion. Compiling a material analysis belongs with the generalist or
reproducible-gis-project. Keep the SQL contribution bounded and supply the
assumptions/evidence needed for that handoff; do not claim to have completed
the whole analysis.
No project template, worked example or OpenMapStack CLI is needed for a bounded
query task. Hand off the SQL and its assumptions to an installed open-map-stack
or reproducible-gis-project if the user also wants a full project. Sibling
skills are optional and are never automatically installed.
For optional product expertise, read references/companion-skills.md.
Keep GIS correctness and the task boundaries above when using a companion.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

