OGR: ogr2ogr

# ogr2ogr

converts simple features data between file formats

Usage:

    Usage: ogr2ogr [-skipfailures] [-append] [-update] [-f format_name] [-gt n]
                   [-select field_list] [-where restricted_where]
                   [-sql <sql statement>] [--help-general]
                   [-spat xmin ymin xmax ymax] [-preserve_fid] [-fid FID]
                   [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
                   [[-dsco NAME=VALUE] ...] dst_datasource_name
                   src_datasource_name
                   [-lco NAME=VALUE] [-nln name] [-nlt type] [layer [layer ...]]

This program can be used to convert simple features data between file formats performing various operations during the process such as spatial or attribute selections, reducing the set of attributes, setting the output coordinate system or even reprojecting the features during translation.

-f format_name:
  output file format name, some possible values are:

           -f "ESRI Shapefile"
           -f "TIGER"
           -f "MapInfo File"
           -f "GML"
           -f "PostgreSQL"

-append:
  Append to existing layer instead of creating new
-overwrite:
  Delete the output layer and recreate it empty
-update:
  Open existing output datasource in update mode rather than trying to create a new one
-select field_list:
  Comma-delimited list of fields from input layer to copy to the new layer (defaults to all)
-sql sql_statement:
  SQL statement to execute. The resulting table/layer will be saved to the output.
-where restricted_where:
  Attribute query (like SQL WHERE)
-skipfailures:
  Continue after a failure, skipping the failed feature.
-gt n:
  group n features per transaction (default 200)
-spat xmin ymin xmax ymax:
  spatial query extents
-dsco NAME=VALUE:
  Dataset creation option (format specific)
-lco NAME=VALUE:
  Layer creation option (format specific)
-nln name:
  Assign an alternate name to the new layer
-nlt type:
  Define the geometry type for the created layer. One of NONE, GEOMETRY, POINT, LINESTRING, POLYGON, GEOMETRYCOLLECTION, MULTIPOINT, MULTIPOLYGON or MULTILINESTRING. Add "25D" to the name to get 2.5D versions.
-a_srs srs_def:
  Assign an output SRS
-t_srs srs_def:
  Reproject/transform to this SRS on output
-s_srs srs_def:
  Override source SRS
-fid fid:
  If provided, only the feature with this feature id will be reported. Operates exclusive of the spatial or attribute queries.

Srs_def can be a full WKT definition (hard to escape properly), or a well known definition (ie. EPSG:4326) or a file with a WKT definition.

Example appending to an existing layer (both flags need to be used):

    % ogr2ogr -update -append -f PostgreSQL PG:dbname=warmerda abc.tab

More examples are given in the individual format pages.

Generated for GDAL by 1.5.9.