OGR2OGR(1) GDAL OGR2OGR(1) (NAME) ogr2ogr - (SYNOPSIS) Usage: ogr2ogr [--help] [--long-usage] [--help-general] [-of ] [-dsco =]... [-lco =]... [[-append]|[-upsert]|[-overwrite]] [-update] [-sql |@] [-dialect ] [-spat ] [-where |@] [-select ] [-nln ] [-nlt ]... [-s_srs ] [[-a_srs ]|[-t_srs ]] []... Field related options: [-addfields] [-relaxedFieldNameMatch] [-fieldTypeToString All|[,]...] [-mapFieldType |All=[,=]...] [-fieldmap [,]...] [-splitlistfields] [-maxsubfields ] [-emptyStrAsNull] [-forceNullable] [-unsetFieldWidth] [-unsetDefault] [-resolveDomains] [-dateTimeTo UTC|UTC(+|-)|UTC(+|-):] [-noNativeData] Advanced geometry and SRS related options: [-dim layer_dim|2|XY|3|XYZ|XYM|XYZM] [-s_coord_epoch ] [-a_coord_epoch ] [-t_coord_epoch ] [-ct ] [-ct_opt =]... [-spat_srs ] [-geomfield ] [-segmentize ] [-simplify ] [-makevalid] [-skipinvalid] [-wrapdateline] [-datelineoffset ] [-clipsrc [ ]|||spat_extent] [-clipsrcsql ] [-clipsrclayer ] [-clipsrcwhere ] [-clipdst [ ]||] [-clipdstsql ] [-clipdstlayer ] [-clipdstwhere ] [-explodecollections] [-zfield ] [-gcp []]... [-tps] [-order 1|2|3] [-xyRes [ m|mm|deg]] [-zRes [ m|mm]] [-mRes ] [-unsetCoordPrecision] Other options: [--quiet] [-progress] [-if ]... [-oo =]... [-doo =]... [-fid ] [-preserve_fid] [-unsetFid] [[-skipfailures]|[-gt |unlimited]] [-limit ] [-ds_transaction] [-mo =]... [-nomd] (DESCRIPTION) ogr2ogr (simple features) . (reprojecting) . : "gdal": o gdal vector clip o gdal vector convert o gdal vector explode-collections (collection) o gdal vector make-valid o gdal vector reproject o gdal vector segmentize o gdal vector select o gdal vector set-field-type o gdal vector set-geom-type o gdal vector simplify o gdal vector sql SQL --help --help-general GDAL . -q, --quiet . -if / () . . . . . 3.2. -of , -f ESRI Shapefile MapInfo File PostgreSQL. . -append . -update . -upsert 3.6. -append OGRLayer::UpsertFeature() OGRLayer::CreateFeature() . : GPKG -- GeoPackage vector Elasticsearch: Geographically Encoded Objects for Elasticsearch MongoDBv3 ( upsert GDAL_DCAP_UPSERT ). upsert FID <<>> ( FID ) . FID . GPKG upsert FID ( -unsetFid FID ) UNIQUE . -overwrite -update -select . GDAL 3.9 (escaped). (shell) . regular_field a_field_with space, and comma a field with " double quote : -select "regular_field,\"a_field_with space, and comma\",\"a field with \\\" double quote\"" . . -select . . -append . -fieldmap -sql . -progress . " " . -sql |@ SQL . / . @filename . ( -spat_srs .) -dialect SQL. OGRSQL SQL RDBMS OGR SQL () . SQL SQLite dialect SQLITE INDIRECT_SQLITE . (-dialect -where . -sql .) -where |@ ( WHERE SQL). @filename . (-dialect -where . -sql .) -skipfailures . -gt . -spat SRS () ( -spat_srs). . -clipsrc . -spat_srs SRS . ( -sql .) -geomfield . -dsco = ( ) -lco = ( ) -nln -nlt . NONE GEOMETRY POINT LINESTRING POLYGON GEOMETRYCOLLECTION MULTIPOINT MULTIPOLYGON MULTILINESTRING CIRCULARSTRING COMPOUNDCURVE CURVEPOLYGON MULTICURVE MULTISURFACE. Z M ZM . PROMOTE_TO_MULTI polygon multipolygon multipolygon linestring multilinestring multilinestring . shapefile PostGIS . CONVERT_TO_LINEAR CONVERT_TO_CURVE (POLYGON CURVEPOLYGON MULTIPOLYGON MULTISURFACE LINESTRING COMPOUNDCURVE MULTILINESTRING MULTICURVE). 2.1 (measured) ("25D" "Z" ). multipolygon -nlt POLYGON Simple Features . GDAL 3.0.5 -nlt CONVERT_TO_LINEAR -nlt PROMOTE_TO_MULTI . -dim val ( XY XYZ XYM XYZM - 2 XY 3 XYZ ). . layer_dim . -a_srs SRS ( -t_srs ) OGRSpatialReference::SetFromUserInput() EPSG ( EPSG:4296) CRS WKT PROJ.4 .prj WKT CRS. -a_coord_epoch 3.4 . (epoch) SRS . SRS CRS . -a_srs . -t_srs / SRS SRS . SRS . SRS -s_srs . OGRSpatialReference::SetFromUserInput() EPSG ( EPSG:4296) CRS WKT PROJ.4 .prj WKT CRS. -t_coord_epoch 3.4 . (epoch) SRS . SRS CRS . -t_srs . -a_coord_epoch ( ) . PROJ 9.4 -s_coord_epoch -t_coord_epoch CRS . -s_srs SRS . SRS . -t_srs . OGRSpatialReference::SetFromUserInput() EPSG ( EPSG:4296) CRS WKT PROJ.4 .prj WKT CRS. -xyRes "[ m|mm|deg]" 3.9 . / (resolution) X/Y . SRS . m mm deg . OGRGeometry::SetPrecision() ( ) ( OGR_APPLY_GEOM_SET_PRECISION NO ). -unsetCoordPrecision ( ) . -zRes "[ m|mm]" 3.9 . / Z . SRS . m mm . -unsetCoordPrecision ( ) . -mRes 3.9 . M / . -unsetCoordPrecision ( ) . -unsetCoordPrecision 3.9 . () . -s_coord_epoch 3.4 . (epoch) SRS . SRS CRS . -s_srs . PROJ 9.4 CRS -s_coord_epoch -t_coord_epoch ( ). -ct 3.0 . PROJ ( +proj=pipeline ) WKT2 CoordinateOperation URN urn:ogc:def:coordinateOperation:EPSG::XXXX CRS . CRS CRS northing/easting step proj=axisswap order=2,1 (pipeline) / CRS northing/easting . -ct_opt = 3.11 . PROJ -ct . : o ONLY_BEST``=``YES/NO. ( PROJ 9.x) ( ) PROJ <<>> . (fallback ) Helmert <<>> (ballpark) (: https://proj.org/glossary.html). YES PROJ <<>> ( Transform()) . ALLOW_BALLPARK``=``NO . PROJ 9.2 . PROJ_ONLY_BEST_DEFAULT only_best_default proj.ini . ONLY_BEST=YES/NO . o ALLOW_BALLPARK``=``YES/NO. (ballpark) . YES . o WARN_ABOUT_DIFFERENT_COORD_OP``=``YES/NO. NO GDAL ( ) . YES . -preserve_fid FID ( FID ). (append mode) FID FID (FID) . -unsetFid . -explodecollections . -fid (feature id) . . : 'fid' OGR SQL . -where "fid in (1,3,5)" 1 3 5 . -limit . -oo = ( ). OGR_SCHEMA (schema) ( ) . JSON JSON OGR_SCHEMA . -doo = ( ) -update . -gt n ( 100 000). (DBMS) . n unlimited . -ds_transaction ( ) FileGDB (emulation) . -clipsrc [ ]|WKT||spat_extent (clip) ( ) : o (bounding box) ( SRS ) o WKT ( POLYGON MULTIPOLYGON SRS ) o o -spat spat_extent. -clipsrc -clipsrclayer -clipsrcwhere -clipsrcsql . -clipsrcsql SQL. -clipsrclayer . -clipsrcwhere . -clipdst [ ]|| (clip) ( ) : o (bounding box) ( SRS ) o WKT ( POLYGON MULTIPOLYGON SRS ) o -clipdst -clipdstlayer -clipdstwhere -clipdstsql . -clipdstsql SQL. -clipdstlayer . -clipdstwhere . -wrapdateline ( = +- ) -datelineoffset ( = +- - ) -simplify . : . OGRGeometry::SimplifyPreserveTopology() . . -t_srs . -segmentize . . -t_srs . -makevalid OGRGeometry::MakeValid() OGRGeometryFactory::removeLowerDimensionSubGeoms() Simple Features . 3.1: ( GEOS) -skipinvalid OGRGeometry::IsValid() Simple Features. . . 3.10: ( GEOS) -fieldTypeToString All|[,]... (string) . : Integer Integer64 Real String Date Time DateTime Binary IntegerList Integer64List RealList StringList. All . CAST OGR SQL SQL . . ( KML GPX) . -oo OGR_SCHEMA ( ). -mapFieldType {|All=[,=]...} . : Integer Integer64 Real String Date Time DateTime Binary IntegerList Integer64List RealList StringList. Integer(Boolean) Real(Float32) ... All . CAST OGR SQL SQL . -fieldTypeToString . . ( KML GPX) . -oo OGR_SCHEMA ( ). -dateTimeTo {UTC|UTC(+|-)|UTC(+|-):} 3.7. - (date time) -dateTimeTo . - localtime . HH [0,14] MM=00 15 30 45 . -unsetFieldWidth 0. -splitlistfields StringList RealList IntegerList String Real Integer. -maxsubfields -splitlistfields . -explodecollections -sql . -preserve_fid -sql "SELECT fid AS original_fid, * FROM ..." FID . -zfield Z . -gcp [] (GCP) . -order -tps . gdal_edit gdal_translate GCP . GCP ( GCP ). -order (warping) ( ). GCP . -tps (thin plate spline) GCP . -fieldmap . n- n- . . -1 . . 'identity' . -append . -addfields -append . -append -addfields . . . -addfields -forceNullable . -relaxedFieldNameMatch . -forceNullable (not-nullable) . -unsetDefault . -unsetFid FID . ORDER BY . -emptyStrAsNull 3.3. null. -resolveDomains 3.3. (coded field domain) ({dstfield}_resolved) . -nomd (metadata) . -mo = . -noNativeData (native data) OGR ( GeoJSON) . . . . . (PERFORMANCE HINTS) (DBMS SQLite/PostgreSQL MySQL ) INSERT BEGIN TRANSACTION COMMIT TRANSACTION . -gt . SQLite -gt 65536 . -skipfailures -gt . PostgreSQL PG_USE_COPY YES . PG . . (KNOWN ISSUES) GDAL 3.8 ogr2ogr ( GeoPackage FlatGeoBuf) API Arrow (.. RFC 86: Column-oriented read API for vector layers). ogr2ogr GDAL 3.8.x GDAL 3.9 . GDAL --config OGR2OGR_USE_ARROW_API NO ogr2ogr (feature-based) . GDAL >= 3.9 GDAL . (RETURN STATUS CODE) ( ). (C API) C GDALVectorTranslate() . (EXAMPLES) : ogr2ogr -append -f PostgreSQL PG:dbname=warmerda abc.tab : : ogr2ogr -spat -13.931 34.886 46.23 74.12 output.gpkg natural_earth_vector.gpkg : -where ogr2ogr -where "\"POP_EST\" < 1000000" \ output.gpkg natural_earth_vector.gpkg ne_10m_admin_0_countries ..SH " (ADVANCED EXAMPLES)" : ETRS_1989_LAEA_52N_10E EPSG:4326 ogr2ogr -wrapdateline -t_srs EPSG:4326 -clipdst -5 40 15 55 france_4326.shp europe_laea.shp : CSV . : ogr2ogr -lco GEOMETRY=AS_XYZ TrackWaypoint.csv TrackWaypoint.kml : . ogrinfo . $ ogrinfo -so CadNSDI.gdb.zip PLSSPoint | grep 'Geometry Column' Geometry Column = SHAPE FileGeodatabase SHAPE SELECT . ogr2ogr -sql "SELECT SHAPE FROM PLSSPoint" \ -lco GEOMETRY=AS_XY -f CSV /vsistdout/ CadNSDI.gdb.zip shapefile OGR SQL _ogr_geometry_ . SQL . (escaped) SELECT : ogr2ogr -sql "SELECT \"_ogr_geometry_\" FROM PLSSPoint" \ -lco GEOMETRY=AS_XY -f CSV /vsistdout/ CadNSDI.shp SQL SQLite geometry . ogr2ogr -sql "SELECT geometry FROM PLSSPoint" -dialect SQLite \ -lco GEOMETRY=AS_XY -f CSV /vsistdout/ CadNSDI.shp (AUTHORS) Frank Warmerdam , Silke Reimer (COPYRIGHT) 1998-2026 August 18, 2026 OGR2OGR(1)