decision-labs/geobase-skills/geobase-project-db-data-import
Claude Code and agent skill by decision-labs/geobase-skills
- community
Checking that the SKILL.md file is still in the repository.
Import local geospatial files (GeoParquet, GeoJSON, GPKG, Shapefile, CSV, Parquet) into project Postgres via ogr2ogr. Triggers on data import, load shapefile, geoparquet ingest, ogr2ogr.
Install
npx vskill@latest install decision-labs/geobase-skills/geobase-project-db-data-importSKILL.md
Project DB: Local Data Import
When to use this skill
- Load a local file into the Geobase project database
- GeoParquet, GeoJSON, GPKG, Shapefile, CSV, Parquet → Postgres
- Needs
DATABASE_URIin the user's local environment (human in the loop — e.g. gitignored.env.db, direnv, or exported shell vars; not in chat) - Not for OSM worker import (
@geobase-worker-osm-import) or Overture Maps (@geobase-worker-overture-import)
Required Inputs
@geobase→ Private beta (CLI not shipped) ifgeobase-cliis unavailable- authenticated CLI session (
geobase-cli login) when CLI is installed project_ref- local file path (for example
.parquet,.geojson,.gpkg,.shp,.csv) - target table name
Secrets (human in the loop)
DATABASE_URI / GEOBASE_DATABASE_URI and the DB password are not available to agents or geobase-cli in usable form. projects env --persona postgres prints placeholders only.
Before import:
- Run
geobase-cli projects env <project-ref> --persona postgres --format dotenvfor host, port, database, user (non-secret). - Ask the user to set the real DB password and a complete
DATABASE_URI/GEOBASE_DATABASE_URIlocally (replace[PASSWORD]/<db-password>). Common patterns: gitignored `.env.db`, direnv, or exporting vars in the shell — whatever they already use. - User loads secrets in their environment; do not ask them to paste the password or URI in chat.
See @geobase → Secrets (human in the loop).
Core Rule
Use ogr2ogr as the default import tool for geospatial vector datasets. For non-geospatial tabular files, use COPY/\copy or Python loaders.
Procedure
- Validate auth/session and project:
geobase-cli whoamigeobase-cli projects refsgeobase-cli projects env <project-ref> --persona postgres --format dotenv
- Source DB credentials from the user's local environment (after they configure it):
- non-secret fields may come from
projects env:GEOBASE_PGHOST,GEOBASE_PGPORT,GEOBASE_PGDATABASE,GEOBASE_PGUSER - password and
DATABASE_URI/GEOBASE_DATABASE_URImust come from the user's side only — never from CLI placeholders or chat
- Validate target table name:
- keep it short;
- use letters/digits/underscores only;
- max length 63.
- strict preflight (required): verify target table does not already exist.
Example SQL check: SELECT to_regclass(format('public.%I', '<target_table>')) IS NULL AS table_available;
- Inspect local file first:
- geospatial:
ogrinfo "<path>" - parquet tabular: inspect schema with
duckdb/Python as needed
- Decide import path:
- geospatial vector data ->
ogr2ogr - plain tabular data ->
\copy/ Python
- Import geospatial vector data (recommended path):
Note:ogr2ograutomatically creates a spatial index on the geometry column during import.
- Optional import modes:
- replace table: add
-overwrite - append rows: add
-append - reproject: add
-t_srs EPSG:4326(or project target SRID)
- Validate import:
- row count query
- geometry validity and SRID checks
- sample data query
Failure Handling
- If auth fails: run
geobase-cli login, then retry. - If project/db connection fails: re-check postgres env output and credentials.
- If geometry import fails:
- run
ogrinfoagain to confirm layer/geometry types; - try
-nlt PROMOTE_TO_MULTI; - set explicit
-t_srsif CRS is missing/mismatched. - If table name errors occur: shorten/sanitize table name.
Security Rules
- Never paste DB passwords in chat.
- Never commit secrets/connection strings to repo files.
- Prefer environment variables or secure local credential storage.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/geobase-project-db-data-import/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/decision-labs/geobase-skills/geobase-project-db-data-import)