1ogr2ogr(1)                  General Commands Manual                 ogr2ogr(1)
2
3
4

NAME

6       ogr2ogr - .TH "ogr2ogr" 1 "Fri Apr 22 2011" "GDAL"
7

NAME

9       ogr2ogr - converts simple features data between file formats
10

SYNOPSIS

12       Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update] [-gt n]
13                      [-select field_list] [-where restricted_where]
14                      [-progress] [-sql <sql statement>] [-dialect dialect]
15                      [-preserve_fid] [-fid FID]
16                      [-spat xmin ymin xmax ymax] [-wrapdateline]
17                      [-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent]
18                      [-clipsrcsql sql_statement] [-clipsrclayer layer]
19                      [-clipsrcwhere expression]
20                      [-clipdst [xmin ymin xmax ymax]|WKT|datasource]
21                      [-clipdstsql sql_statement] [-clipdstlayer layer]
22                      [-clipdstwhere expression]
23                      [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
24                      [-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]
25                      [-segmentize max_dist] [-fieldTypeToString All|(type1[,type2]*)]
26                      dst_datasource_name src_datasource_name
27                      [-lco NAME=VALUE] [-nln name] [-nlt type] [layer [layer ...]]
28

DESCRIPTION

30       This program can be used to convert simple features data between file
31       formats performing various operations during the process such as
32       spatial or attribute selections, reducing the set of attributes,
33       setting the output coordinate system or even reprojecting the features
34       during translation.
35
36        -f format_name:
37           output file format name (default is ESRI Shapefile), some possible
38           values are:
39
40            -f "ESRI Shapefile"
41            -f "TIGER"
42            -f "MapInfo File"
43            -f "GML"
44            -f "PostgreSQL"
45
46
47       -append:
48           Append to existing layer instead of creating new
49
50       -overwrite:
51           Delete the output layer and recreate it empty
52
53       -update:
54           Open existing output datasource in update mode rather than trying
55           to create a new one
56
57       -select field_list:
58           Comma-delimited list of fields from input layer to copy to the new
59           layer. A field is skipped if mentioned previously in the list even
60           if the input layer has duplicate field names. (Defaults to all; any
61           field is skipped if a subsequent field with same name is found.)
62
63       -progress:
64           (starting with GDAL 1.7.0) Display progress on terminal. Only works
65           if input layers have the 'fast feature count' capability.
66
67       -sql sql_statement:
68           SQL statement to execute. The resulting table/layer will be saved
69           to the output.
70
71       -dialect dialect:
72           SQL dialect. In some cases can be used to use (unoptimized) OGR SQL
73           instead of the native SQL of an RDBMS by passing OGRSQL.
74
75       -wrapdateline:
76           (starting with GDAL 1.7.0) split geometries crossing the dateline
77           meridian (long. = +/- 180deg)
78
79       -where restricted_where:
80           Attribute query (like SQL WHERE)
81
82       -skipfailures:
83           Continue after a failure, skipping the failed feature.
84
85       -gt n:
86           group n features per transaction (default 200)
87
88       -spat xmin ymin xmax ymax:
89           spatial query extents. Only features whose geometry intersects the
90           extents will be selected. The geometries will not be clipped unless
91           -clipsrc is specified
92
93       -clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent:
94           (starting with GDAL 1.7.0) clip geometries to the specified
95           bounding box (expressed in source SRS), WKT geometry (POLYGON or
96           MULTIPOLYGON), from a datasource or to the spatial extent of the
97           -spat option if you use the spat_extent keyword. When specifying a
98           datasource, you will generally want to use it in combination of the
99           -clipsrclayer, -clipsrcwhere or -clipsrcsql options
100
101       -clipsrcsql sql_statement:
102           Select desired geometries using an SQL query instead.
103
104       -clipsrclayer layername:
105           Select the named layer from the source clip datasource.
106
107       -clipsrcwhere expression:
108           Restrict desired geometries based on attribute query.
109
110       -clipdst xmin ymin xmax ymax:
111           (starting with GDAL 1.7.0) clip geometries after reprojection to
112           the specified bounding box (expressed in dest SRS), WKT geometry
113           (POLYGON or MULTIPOLYGON) or from a datasource. When specifying a
114           datasource, you will generally want to use it in combination of the
115           -clipdstlayer, -clipdstwhere or -clipdstsql options
116
117       -clipdstsql sql_statement:
118           Select desired geometries using an SQL query instead.
119
120       -clipdstlayer layername:
121           Select the named layer from the destination clip datasource.
122
123       -clipdstwhere expression:
124           Restrict desired geometries based on attribute query.
125
126       -dsco NAME=VALUE:
127           Dataset creation option (format specific)
128
129       -lco NAME=VALUE:
130           Layer creation option (format specific)
131
132       -nln name:
133           Assign an alternate name to the new layer
134
135       -nlt type:
136           Define the geometry type for the created layer. One of NONE,
137           GEOMETRY, POINT, LINESTRING, POLYGON, GEOMETRYCOLLECTION,
138           MULTIPOINT, MULTIPOLYGON or MULTILINESTRING. Add '25D' to the name
139           to get 2.5D versions.
140
141       -a_srs srs_def:
142           Assign an output SRS
143
144       -t_srs srs_def:
145           Reproject/transform to this SRS on output
146
147       -s_srs srs_def:
148           Override source SRS
149
150       -fid fid:
151           If provided, only the feature with this feature id will be
152           reported. Operates exclusive of the spatial or attribute queries.
153           Note: if you want to select several features based on their feature
154           id, you can also use the fact the 'fid' is a special field
155           recognized by OGR SQL. So, '-where 'fid in (1,3,5)'' would select
156           features 1, 3 and 5.
157
158       -segmentize max_dist:
159           (starting with GDAL 1.6.0) maximum distance between 2 nodes. Used
160           to create intermediate pointsspatial query extents
161
162       -fieldTypeToString type1, ...:
163           (starting with GDAL 1.7.0) converts any field of the specified type
164           to a field of type string in the destination layer. Valid types are
165           : Integer, Real, String, Date, Time, DateTime, Binary, IntegerList,
166           RealList, StringList. Special value All can be used to convert all
167           fields to strings. This is an alternate way to using the CAST
168           operator of OGR SQL, that may avoid typing a long SQL query.
169
170       Srs_def can be a full WKT definition (hard to escape properly), or a
171       well known definition (ie. EPSG:4326) or a file with a WKT definition.
172
173       Example appending to an existing layer (both flags need to be used):
174
175       % ogr2ogr -update -append -f PostgreSQL PG:dbname=warmerda abc.tab
176
177       Example reprojecting from ETRS_1989_LAEA_52N_10E to EPSG:4326 and
178       clipping to a bounding box
179
180       % ogr2ogr -wrapdateline -t_srs EPSG:4326 -clipdst -5 40 15 55 france_4326.shp europe_laea.shp
181
182       More examples are given in the individual format pages.
183

AUTHORS

185       Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer
186       <silke@intevation.de>
187
188
189
190GDAL                            Fri Apr 22 2011                     ogr2ogr(1)
Impressum