GDAL ogr2ogr
$ ogr2ogr Foundation Med Riskogr2ogr (paired with ogrinfo) is OSGeo's industry-standard geospatial vector ETL CLI. It converts and reprojects between 80+ vector formats—including GeoJSON, GeoParquet (-f Parquet), Shapefile, GeoPackage, and PostGIS—with OGR SQL attribute/spatial filtering.
brew install gdal Performs exact coordinate reprojections (-t_srs) and GeoParquet/GeoJSON/Shapefile conversions locally using GDAL/PROJ without custom Python geopandas scripts.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive and supports /vsistdout/ plus ogrinfo -json, though destination-before-source argument order and C++ driver flags require care.
- Supports
-sql,/vsistdout/, and companionogrinfo -json - Non-standard
dst srcargument order
Explicit destination file or PostGIS DSN required; -overwrite and -update can replace existing layers if specified.
- Destination-first syntax;
-overwriteposes table replacement risk
Heavyweight C++ suite (gdal, proj, geos, arrow) via Homebrew/conda/apt; driver availability (Parquet) depends on build flags.
- Large native dependency tree; driver support varies by build
Unmatched 80+ geospatial vector format support, spatial clipping (-clipsrc), and CRS reprojection (-t_srs).
- Canonical geospatial ETL across GeoJSON, GeoParquet, Shapefile, PostGIS
Flagship OSGeo foundation project (OSGeo/gdal) under MIT license.
- Official OSGeo
OSGeo/gdalrepository
Extensive gdal.org manual, though driver-specific -lco/-dsco options span dozens of pages.
- Comprehensive docs at gdal.org/en/stable/programs/ogr2ogr.html
Security, Auth & Guardrails
None for local files; PostGIS or cloud /vsis3/ drivers read standard libpq (PGPASSWORD, ~/.pgpass) or AWS env credentials.
MIT open-source OSGeo suite; completely free.
# GDAL ogr2ogr Agent Rules - Note argument order: `ogr2ogr [opts] <dst_dataset> <src_dataset>` (destination comes FIRST!). - Inspect metadata first with `ogrinfo -json -so <file>` before converting. - Avoid `-overwrite` on existing PostGIS tables or GeoPackages without explicit user approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
ogrinfo -json -so input.parquet
Uses companion ogrinfo -json -so (summary only) to inspect CRS, geometry type, and attribute schema.
ogr2ogr -f GeoJSON /vsistdout/ input.parquet -sql "SELECT name, geom FROM input LIMIT 20"
Queries attributes with -sql and streams GeoJSON directly to /vsistdout/ without writing a file.
Controlled Writes & Previews
ogr2ogr -f Parquet -t_srs EPSG:4326 out.parquet in.geojson
Reprojects vector features to WGS84 and writes an Apache GeoParquet file (out.parquet).
Strengths for Agents
- + Supports 80+ geospatial formats including GeoJSON, GeoParquet, Shapefile, FlatGeobuf, and PostGIS.
- + Companion
ogrinfo -json -sogives agents clean JSON schema & CRS summaries. - + Accurate coordinate transforms via PROJ (
-s_srs/-t_srs).
Caveats & Pitfalls
- ! Destination comes before source (
ogr2ogr dst src)—reversing them can overwrite the input file! - ! GeoParquet (
-f Parquet) requires a GDAL build compiled with Apache Arrow/Parquet support (ogr2ogr --formatsto check).