1OGRINFO(1) GDAL OGRINFO(1)
2
3
4
6 ogrinfo - Lists information about an OGR-supported data source.
7
9 ogrinfo [--help-general] [-ro] [-q] [-where restricted_where|\@filename]
10 [-spat xmin ymin xmax ymax] [-geomfield field] [-fid fid]
11 [-sql statement|\@filename] [-dialect dialect] [-al] [-rl] [-so] [-fields={YES/NO}]
12 [-geom={YES/NO/SUMMARY/WKT/ISO_WKT}] [--formats] [[-oo NAME=VALUE] ...]
13 [-nomd] [-listmdd] [-mdd domain|`all`]*
14 [-nocount] [-noextent] [-nogeomtype] [-wkt_format WKT1|WKT2|...]
15 <datasource_name> [<layer> [<layer> ...]]
16
18 The ogrinfo program lists various information about an OGR-supported
19 data source to stdout (the terminal).
20
21 -ro Open the data source in read-only mode.
22
23 -al List all features of all layers (used instead of having to give
24 layer names as arguments).
25
26 -rl Enable random layer reading mode, i.e. iterate over features in
27 the order they are found in the dataset, and not layer per
28 layer. This can be significantly faster for some formats (for
29 example OSM, GMLAS).
30
31 New in version 2.2.
32
33
34 -so Summary Only: suppress listing of individual features and show
35 only summary information like projection, schema, feature count
36 and extents.
37
38 -q Quiet verbose reporting of various information, including coor‐
39 dinate system, layer schema, extents, and feature count.
40
41 -where <restricted_where>
42 An attribute query in a restricted form of the queries used in
43 the SQL WHERE statement. Only features matching the attribute
44 query will be reported. Starting with GDAL 2.1, the \filename
45 syntax can be used to indicate that the content is in the
46 pointed filename.
47
48 -sql <statement>
49 Execute the indicated SQL statement and return the result.
50 Starting with GDAL 2.1, the @filename syntax can be used to
51 indicate that the content is in the pointed filename.
52
53 -dialect <dialect>
54 SQL dialect. In some cases can be used to use (unoptimized) OGR
55 SQL instead of the native SQL of an RDBMS by passing OGRSQL. The
56 "SQLITE" dialect can also be used with any datasource.
57
58 -spat <xmin> <ymin> <xmax> <ymax>
59 The area of interest. Only features within the rectangle will be
60 reported.
61
62 -geomfield <field>
63 Name of the geometry field on which the spatial filter operates.
64
65 -fid <fid>
66 If provided, only the feature with this feature id will be
67 reported. Operates exclusive of the spatial or attribute
68 queries. Note: if you want to select several features based on
69 their feature id, you can also use the fact the 'fid' is a spe‐
70 cial field recognized by OGR SQL. So, -where "fid in (1,3,5)"
71 would select features 1, 3 and 5.
72
73 -fields YES|NO:
74 If set to NO, the feature dump will not display field values.
75 Default value is YES.
76
77 -geom YES|NO|SUMMARY|WKT|ISO_WKT
78 If set to NO, the feature dump will not display the geometry. If
79 set to SUMMARY, only a summary of the geometry will be dis‐
80 played. If set to YES or ISO_WKT, the geometry will be reported
81 in full OGC WKT format. If set to WKT the geometry will be
82 reported in legacy WKT. Default value is YES. (WKT and ISO_WKT
83 are available starting with GDAL 2.1, which also changes the
84 default to ISO_WKT)
85
86 -oo NAME=VALUE
87 Dataset open option (format-specific)
88
89 -nomd Suppress metadata printing. Some datasets may contain a lot of
90 metadata strings.
91
92 -listmdd
93 List all metadata domains available for the dataset.
94
95 -mdd <domain>
96 Report metadata for the specified domain. all can be used to
97 report metadata in all domains.
98
99 -nocount
100 Suppress feature count printing.
101
102 -noextent
103 Suppress spatial extent printing.
104
105 -nogeomtype
106 Suppress layer geometry type printing.
107
108 New in version 3.1.
109
110
111 --formats
112 List the format drivers that are enabled.
113
114 -wkt_format <format>
115 The WKT format used to display the SRS. Currently supported
116 values for the format are:
117
118 WKT1
119
120 WKT2 (latest WKT version, currently WKT2_2018)
121
122 WKT2_2015
123
124 WKT2_2018
125
126 New in version 3.0.0.
127
128
129 <datasource_name>
130 The data source to open. May be a filename, directory or other
131 virtual name. See the OGR Vector Formats list for supported
132 datasources.
133
134 <layer>
135 One or more layer names may be reported. If no layer names are
136 passed then ogrinfo will report a list of available layers (and
137 their layer wide geometry type). If layer name(s) are given then
138 their extents, coordinate system, feature count, geometry type,
139 schema and all features matching query parameters will be
140 reported to the terminal. If no query parameters are provided,
141 all features are reported.
142
143 Geometries are reported in OGC WKT format.
144
146 Example reporting all layers in an NTF file:
147
148 ogrinfo wrk/SHETLAND_ISLANDS.NTF
149
150 # INFO: Open of `wrk/SHETLAND_ISLANDS.NTF'
151 # using driver `UK .NTF' successful.
152 # 1: BL2000_LINK (Line String)
153 # 2: BL2000_POLY (None)
154 # 3: BL2000_COLLECTIONS (None)
155 # 4: FEATURE_CLASSES (None)
156
157 Example of retrieving a summary (-so) of a layer without showing
158 details about every single feature.
159
160 ogrinfo \
161 -so \
162 natural_earth_vector.gpkg \
163 ne_10m_admin_0_antarctic_claim_limit_lines
164
165 # INFO: Open of `natural_earth_vector.gpkg'
166 # using driver `GPKG' successful.
167
168 # Layer name: ne_10m_admin_0_antarctic_claim_limit_lines
169 # Geometry: Line String
170 # Feature Count: 23
171 # Extent: (-150.000000, -90.000000) - (160.100000, -60.000000)
172 # Layer SRS WKT:
173 # GEOGCS["WGS 84",
174 # DATUM["WGS_1984",
175 # SPHEROID["WGS 84",6378137,298.257223563,
176 # AUTHORITY["EPSG","7030"]],
177 # AUTHORITY["EPSG","6326"]],
178 # PRIMEM["Greenwich",0,
179 # AUTHORITY["EPSG","8901"]],
180 # UNIT["degree",0.0174532925199433,
181 # AUTHORITY["EPSG","9122"]],
182 # AUTHORITY["EPSG","4326"]]
183 # FID Column = fid
184 # Geometry Column = geom
185 # type: String (15.0)
186 # scalerank: Integer (0.0)
187 # featurecla: String (50.0)
188
189 Example using an attribute query is used to restrict the output of the
190 features in a layer:
191
192 ogrinfo -ro \
193 -where 'GLOBAL_LINK_ID=185878' \
194 wrk/SHETLAND_ISLANDS.NTF BL2000_LINK
195
196 # INFO: Open of `wrk/SHETLAND_ISLANDS.NTF'
197 # using driver `UK .NTF' successful.
198 #
199 # Layer name: BL2000_LINK
200 # Geometry: Line String
201 # Feature Count: 1
202 # Extent: (419794.100000, 1069031.000000) - (419927.900000, 1069153.500000)
203 # Layer SRS WKT:
204 # PROJCS["OSGB 1936 / British National Grid",
205 # GEOGCS["OSGB 1936",
206 # DATUM["OSGB_1936",
207 # SPHEROID["Airy 1830",6377563.396,299.3249646]],
208 # PRIMEM["Greenwich",0],
209 # UNIT["degree",0.0174532925199433]],
210 # PROJECTION["Transverse_Mercator"],
211 # PARAMETER["latitude_of_origin",49],
212 # PARAMETER["central_meridian",-2],
213 # PARAMETER["scale_factor",0.999601272],
214 # PARAMETER["false_easting",400000],
215 # PARAMETER["false_northing",-100000],
216 # UNIT["metre",1]]
217 # LINE_ID: Integer (6.0)
218 # GEOM_ID: Integer (6.0)
219 # FEAT_CODE: String (4.0)
220 # GLOBAL_LINK_ID: Integer (10.0)
221 # TILE_REF: String (10.0)
222 # OGRFeature(BL2000_LINK):2
223 # LINE_ID (Integer) = 2
224 # GEOM_ID (Integer) = 2
225 # FEAT_CODE (String) = (null)
226 # GLOBAL_LINK_ID (Integer) = 185878
227 # TILE_REF (String) = SHETLAND I
228 # LINESTRING (419832.100 1069046.300,419820.100 1069043.800,419808.300
229 # 1069048.800,419805.100 1069046.000,419805.000 1069040.600,419809.400
230 # 1069037.400,419827.400 1069035.600,419842 1069031,419859.000
231 # 1069032.800,419879.500 1069049.500,419886.700 1069061.400,419890.100
232 # 1069070.500,419890.900 1069081.800,419896.500 1069086.800,419898.400
233 # 1069092.900,419896.700 1069094.800,419892.500 1069094.300,419878.100
234 # 1069085.600,419875.400 1069087.300,419875.100 1069091.100,419872.200
235 # 1069094.600,419890.400 1069106.400,419907.600 1069112.800,419924.600
236 # 1069133.800,419927.900 1069146.300,419927.600 1069152.400,419922.600
237 # 1069153.500,419917.100 1069153.500,419911.500 1069153.000,419908.700
238 # 1069152.500,419903.400 1069150.800,419898.800 1069149.400,419894.800
239 # 1069149.300,419890.700 1069149.400,419890.600 1069149.400,419880.800
240 # 1069149.800,419876.900 1069148.900,419873.100 1069147.500,419870.200
241 # 1069146.400,419862.100 1069143.000,419860 1069142,419854.900
242 # 1069138.600,419850 1069135,419848.800 1069134.100,419843
243 # 1069130,419836.200 1069127.600,419824.600 1069123.800,419820.200
244 # 1069126.900,419815.500 1069126.900,419808.200 1069116.500,419798.700
245 # 1069117.600,419794.100 1069115.100,419796.300 1069109.100,419801.800
246 # 1069106.800,419805.000 1069107.300)
247
249 Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@inteva‐
250 tion.de>
251
253 1998-2021
254
255
256
257
258 Jan 05, 2021 OGRINFO(1)