gdal-spatial
Skill4 starsChanged 15 days agoBSD-3-ClauseView on GitHub
Read and convert remote geospatial files with GDAL/OGR. Covers the VSI virtual filesystem layer (/vsicurl/, /vsis3/) that enables remote access without downloading, when to use each prefix, ogrinfo and ogr2ogr patterns, geometry edge cases, and when to use DuckDB instead. Use when inspecting or converting GDB, GPKG, Shapefile, GeoTIFF, GeoParquet, or other formats locally or from remote URLs.
- Installs packages
In this repository18 other files it gives its agents.
- boettiger-lab-stackSkill
- cng-datasetsSkill
- disclose-tool-useSkill
- duckdb-spatialSkill
- github-app-authSkill
- github-rulesetsSkill
- html-figuresSkill
- human-communication-consentSkill
- k8s-never-force-deleteSkill
- nrp-kubernetesSkill
- nrp-s3Skill
- oci-artifactsSkill
- pod-resourcesSkill
- python-envSkill
- reproducible-reportsSkill
- stacked-pr-squash-mergeSkill
- stac-navigationSkill
- writing-voiceSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 85
Key principle: Use GDAL for format conversion and inspection.
- Distinctive: line 89
GDAL is often not built with the Parquet (Arrow) driver: Check before assuming:
- Very specific: line 96
No output means GDAL cannot read or write Parquet.
- Very specific: line 98
When GDAL lacks Parquet support, use DuckDB's native read_parquet() for reading and DuckDB COPY ...
≈ “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
GDAL/OGR for Remote Geospatial Data
GDAL/OGR is the foundational library for reading and writing geospatial vector and raster formats. Its virtual filesystem (VSI) layer makes it possible to read remote files over HTTP or S3 without downloading them first.
The VSI Virtual Filesystem: Why Prefixes Matter
GDAL was designed around local file paths. To extend it to remote storage, GDAL uses a virtual filesystem (VSI) layer that intercepts path strings and transparently handles the I/O. Any GDAL tool (ogrinfo, ogr2ogr, Python GDAL, and even DuckDB's bundled GDAL via ST_Read()) can read remote files simply by prepending the right prefix.
Without VSI prefixes, you would have to download the entire file before GDAL could inspect or convert it — which is impractical for large files and impossible for selective layer reads.
Core VSI Prefixes
| Prefix | Protocol | Read | Write | Auth |
/vsicurl/ | HTTP/HTTPS | yes | no | none (public) |
/vsis3/ | S3 API | yes | yes | AWS credentials |
/vsistdout/ | stdout pipe | — | yes | — |
/vsizip/ | ZIP archive | yes | no | none |
/vsicurl_streaming/ | HTTP (sequential) | yes | no | none |
/vsicurl/ vs /vsis3/ — When to Use Each
Use /vsicurl/ when:
- The file is publicly accessible via an HTTPS URL
- You are reading from any S3-compatible endpoint using its public HTTP URL (e.g.,
https://s3-west.nrp-nautilus.io/bucket/file.gdb) - You do not have or need S3 credentials
Use /vsis3/ when:
- You have S3 credentials configured and the bucket requires authentication
- You need to write output directly to S3 (only
/vsis3/supports write) - The file is in a private bucket, or you want efficient authenticated range requests via the S3 API
The key differences:
/vsicurl/is read-only;/vsis3/supports both read and write/vsicurl/requires a full HTTPS URL;/vsis3/takesbucket/path(no protocol or hostname)/vsis3/requires credentials and optionally a custom endpoint
Converting Between URL Styles
# Public HTTPS URL → vsicurl
https://s3-west.nrp-nautilus.io/bucket/path/data.gdb
→ /vsicurl/https://s3-west.nrp-nautilus.io/bucket/path/data.gdb
# s3:// URL → vsis3 (authenticated) or vsicurl (public endpoint)
s3://bucket/path/data.gdb
→ /vsis3/bucket/path/data.gdb (authenticated S3)
→ /vsicurl/https://s3-west.nrp-nautilus.io/bucket/path/data.gdb (public HTTP access)S3 Credentials for /vsis3/
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_S3_ENDPOINT=rook-ceph-rgw-nautiluss3.rook # internal k8s endpoint
export AWS_HTTPS=NO
export AWS_VIRTUAL_HOSTING=FALSEFor public S3 endpoints, /vsicurl/ with the full HTTPS URL requires no configuration.
Choosing the Right Tool
| Task | Best tool |
| Inspect layers in a remote GDB/GPKG | ogrinfo with /vsicurl/ |
| Convert GDB/Shapefile → GeoParquet | ogr2ogr |
| Query/filter a GeoParquet file | DuckDB native read_parquet() |
| Spatial joins and aggregation | DuckDB spatial extension |
| Convert GeoParquet → GeoJSONSeq | ogr2ogr |
| Stream output to tippecanoe | ogr2ogr with /vsistdout/ |
| Reproject raster data | gdalwarp |
| Create COG from GeoTIFF | gdal_translate / gdalwarp |
Key principle: Use GDAL for format conversion and inspection; use DuckDB for analytics on Parquet. See the duckdb-spatial skill for DuckDB usage.
GDAL Parquet Driver Availability
GDAL is often not built with the Parquet (Arrow) driver. Check before assuming:
ogrinfo --formats | grep -i parquet
ogrinfo --formats | grep -i arrowNo output means GDAL cannot read or write Parquet. The ghcr.io/osgeo/gdal:ubuntu-full-latest Docker image includes the Parquet driver. Most system installs (apt install gdal-bin) do not.
When GDAL lacks Parquet support, use DuckDB's native read_parquet() for reading and DuckDB COPY ... TO 's3://...' for writing.
OGR: Inspecting Remote Data
List layers in a multi-layer source
ogrinfo /vsicurl/https://s3-west.nrp-nautilus.io/public-padus/raw/PADUS4_1Geodatabase.gdbGet layer schema and feature count
# Summary only — essential for remote files (without -so, ogrinfo dumps every feature)
ogrinfo -so /vsicurl/https://example.com/data.gdb LayerName
# All layers summary
ogrinfo -so -al /vsicurl/https://example.com/data.gdbCount features in a layer
ogrinfo -so /vsicurl/https://example.com/data.gdb LayerName | grep "Feature Count"OGR: Format Conversion
GDB layer → GeoParquet
ogr2ogr -f Parquet output.parquet /vsicurl/https://example.com/data.gdb "LayerName"GDB layer → GeoJSONSeq
ogr2ogr -f GeoJSONSeq output.geojsonl /vsicurl/https://example.com/data.gdb "LayerName" -progressWrite directly to S3
# Read from S3, write to S3 (requires credentials set via AWS_* env vars)
ogr2ogr -f Parquet /vsis3/bucket/output.parquet /vsis3/bucket/raw/source.gdb "LayerName" -progressStream to tippecanoe for PMTiles
ogr2ogr -f GeoJSONSeq /vsistdout/ /vsis3/bucket/data.gdb "LayerName" \
| tippecanoe -o output.pmtiles -l layername \
--drop-densest-as-needed --extend-zooms-if-still-dropping --forceGeometry Edge Cases
Curved geometries (MULTISURFACE, CURVEPOLYGON)
Some GDB files contain curved geometry types that downstream tools cannot handle. Linearize during conversion:
ogr2ogr -f GPKG \
-nlt CONVERT_TO_LINEAR \
-nlt PROMOTE_TO_MULTI \
output.gpkg input.gdb "LayerName"-nlt CONVERT_TO_LINEAR— converts CircularString, CompoundCurve, CurvePolygon, MultiSurface to linear equivalents-nlt PROMOTE_TO_MULTI— ensures consistent multi-geometry types
For large files with mixed curved/linear geometry, a two-step pipeline (GDB → GPKG → Parquet) is more reliable than a single pass.
FID issues
Some formats (GDB especially) include an FID column that can cause Arrow type mapping issues:
ogr2ogr -f Parquet output.parquet input.gdb "LayerName" -unsetFidCommon Pitfalls
- Forgetting
-sowith remote ogrinfo — Without summary-only mode, ogrinfo tries to dump every feature over the network. - Assuming GDAL has Parquet support — Check
ogrinfo --formats | grep -i parquet. Most system installs lack it; use DuckDB instead. - Using
/vsicurl/when you need to write —/vsicurl/is read-only. Use/vsis3/for output to S3. - Passing
s3://URLs to GDAL tools — GDAL does not understands3://protocol strings. Convert to/vsis3/bucket/pathor/vsicurl/https://endpoint/bucket/path. - Curved geometries breaking downstream tools — Always check with
ogrinfoand linearize GDB sources if MULTISURFACE or CURVEPOLYGON types are present.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

