postgis-spatial-sql
Skill by muend
Guides spatial SQL work on PostGIS, DuckDB Spatial and SpatiaLite, covering backend choice, indexes, predicates and query tuning. Intended for GIS and data engineers running recurring or large spatial queries.
Install postgis-spatial-sql
Built from the published package, never by AI.
git clone --depth 1 https://github.com/muend/geoai-skills /tmp/geoai-skills && mkdir -p ~/.claude/skills && cp -r /tmp/geoai-skills/skills/postgis-spatial-sql ~/.claude/skills/postgis-spatial-sqlRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/muend/geoai-skills /tmp/geoai-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/geoai-skills/skills/postgis-spatial-sql ~/.gemini/antigravity-cli/skills/postgis-spatial-sqlAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install postgis-spatial-sql in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
PostGIS Spatial SQL is a skill that helps an assistant choose a backend and write spatial SQL. It covers PostGIS, DuckDB Spatial and SpatiaLite, typed geometry schemas, GiST and BRIN indexes, KNN queries, and geometry versus geography choices. It also includes an EXPLAIN-based performance playbook and a checklist of common pitfalls, such as ST_Area on 4326 geometry and ST_Distance used in place of ST_DWithin.
The skill asks for data volume, concurrency and operational needs before recommending a backend. It calls for row-count accounting, SRID and geometry type checks, and map sampling to verify results. It is aimed at GIS and data engineers who write spatial SQL for managed services or local analytics. File-based ETL without spatial SQL is handled by a separate geo-data-engineering skill.
Written from the project's SKILL.md and checked against it.
What it can do
- Backend selectionHelps choose between PostGIS for concurrent services and embedded engines for bounded local analytics.
- Schema designShows typed geometry columns with SRIDs and GiST or BRIN index guidance.
- Spatial predicatesCovers ST_Intersects, ST_DWithin and KNN ordering with the distance operator.
- Performance tuningUses EXPLAIN ANALYZE review, ST_Subdivide for large polygons and avoiding ST_Transform in joins.
- Analytical patternsProvides area-weighted aggregation and attribute dissolve with ST_Union.
- DuckDB Spatial quick pathRuns spatial joins directly on GeoParquet, Shapefile and GPKG files without a server.
- Verification protocolSpecifies row-count accounting, SRID and geometry type checks, and sample map review.
- Pitfalls checklistLists common errors such as Web Mercator area measurement and buffer(0) repair.
What you need
- A PostgreSQL database with PostGIS, or DuckDB with the spatial extension
Try asking
- Should I use PostGIS or DuckDB Spatial for my nightly parcel joins?
- Write an indexed point-in-polygon join between points and admin boundaries.
- Check my spatial tables for mixed SRIDs and invalid geometries.
Good to know
- DuckDB Spatial has no GiST index and plans its own joins, so the source says to benchmark rather than assume.
- Backend recommendations should wait for current volume, concurrency and SLA data.
- Area-weighted interpolation assumes uniform density within source units.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/postgis-spatial-sql/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to postgis-spatial-sql
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
postgis-spatial-sql: common questions
Does it cover geometry versus geography?
Yes. The source explains storing geometry in a projected SRID for regional analysis and geography in SRID 4326 for global extents. It warns against using ST_Area on 4326 geometry.
Does it replace file-based GIS ETL?
No. The source says acquisition, conversion and file-based ETL without spatial SQL belong to the geo-data-engineering skill.
Which spatial databases does it target?
The source names PostGIS, DuckDB Spatial and SpatiaLite as the covered backends.
How do I install postgis-spatial-sql?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is postgis-spatial-sql free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is postgis-spatial-sql safe to use?
It scores 70 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to postgis-spatial-sql?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
