GDAL-VECTOR-INFO(1)
GDAL-VECTOR-INFO(1) π
okay bestie, welcome to the GDAL manual page for gdal-vector-info β yes that's the manual name, we're doing this properly. Sit down, grab a strawberry π, we're about to get so much information out of a vector dataset.
β¨ NAME β¨
gdal-vector-info β Get information on a vector dataset π
Added in version 3.11. π
πΈ SYNOPSIS πΈ
Usage: gdal vector info [OPTIONS] <INPUT>...
Return information on a vector dataset.
Positional arguments:
-i, --dataset, --input <INPUT> Input vector datasets [may be repeated] [required]
Common Options:
-h, --help Display help message and exit
--json-usage Display usage as JSON document and exit
--config <KEY>=<VALUE> Configuration option [may be repeated]
Options:
-f, --of, --format, --output-format <OUTPUT-FORMAT> Output format. OUTPUT-FORMAT=json|text
-l, --layer, --input-layer <INPUT-LAYER> Input layer name [may be repeated]
Mutually exclusive with --sql, --fid
--features List all features (beware of RAM consumption on large layers)
Mutually exclusive with --summary
--summary List the layer names and the geometry type
Mutually exclusive with --features
--limit <FEATURE-COUNT> Limit the number of features per layer (implies --features)
--sql <statement>|@<filename> Execute the indicated SQL statement and return the result
Mutually exclusive with --input-layer, --fid
--where <WHERE>|@<filename> Attribute query in a restricted form of the queries used in the SQL WHERE statement
--fid <FID> Feature identifier
Mutually exclusive with --input-layer, --sql
--dialect <DIALECT> SQL dialect
Advanced Options:
--oo, --open-option <KEY>=<VALUE> Open options [may be repeated]
--if, --input-format <INPUT-FORMAT> Input formats [may be repeated]
Esoteric Options:
--crs-format <CRS-FORMAT> Which format to use to report CRS. CRS-FORMAT=AUTO|WKT2|PROJJSON (default: AUTO)
π¦ DESCRIPTION π¦
gdal vector info lists various information about a GDAL supported vector dataset, and returns them on the standard output stream when used from the command line, or in the output parameter when used from the API. yes, it's giving "tell me everything about yourself" energy and honestly? iconic.
Starting with GDAL 3.12, gdal vector info can be used as the last step of a pipeline. π°β¨
The following options are available: (scroll, bestie, there's a lot and they're all worth it)
π PROGRAM-SPECIFIC OPTIONS π
--dialect <dialect>β SQL dialect. In some cases can be used to use (unoptimized) OGR SQL dialect instead of the native SQL of an RDBMS by passing theOGRSQLdialect value. The SQL SQLite dialect can be selected with theSQLITEandINDIRECT_SQLITEdialect values, and this can be used with any datasource. π£οΈ--featuresβ List all features by default, unless limited with--limit. Beware of RAM consumption on large layers when using JSON output. π This option is mutually exclusive with the--summaryoption.-f,--of,--format,--output-format json|textβ Which output format to use. Default isJSON, and starting with GDAL 3.12,textwhen invoked from command line. π-l,--layer,--input-layer <INPUT-LAYER>β Name of one or more layers to inspect. If no layer names are passed and--sqlis not specified, then all layers will be selected. π«Ά--limit <FEATURE-COUNT>β Added in version 3.12. Limit the number of features reported per layer. When set, this implies--features. β¨--sql <statement>|@<filename>β Execute the indicated SQL statement and return the result. The@<filename>syntax can be used to indicate that the content is in the pointed filename (e.g@my_select.txtwheremy_select.txtis a file in the current directory). Data can also be edited with SQLINSERT,UPDATE,DELETE,DROP TABLE,ALTER TABLEetc if the dataset is opened in update mode. Editing capabilities depend on the selected dialect with--dialect. not me letting you write to your own dataset, go off π
This option is mutually exclusive with the --where option.
--summaryβ Print a summary with the list of layers and the geometry type of each layer. This option is mutually exclusive with the--featuresoption. π--where <WHERE>|@<filename>β An attribute query in a restricted form of the queries used in the SQL WHERE statement. Only features matching the attribute query will be reported. The@<filename>syntax can be used to indicate that the content is in the pointed filename.
Example of --where and quoting:
--where "\"Corner Point Identifier\" LIKE '%__00_00'"
This option is mutually exclusive with the --sql option. π
--fid <FID>β Added in version 3.13. Feature identifier. Only the feature with the specified FID will be reported. π―--crs-format AUTO|WKT2|PROJJSONβ Added in version 3.13. Which format to use to report the CRS. InAUTOdefault mode, if the CRS can be captured with an authority name and code (known of PROJ), only a summary of the CRS, including its name, ID, type and area of use will be reported. Otherwise a fullWKT2:2019definition will be reported. π
NOTE:--crs-formatcan only be set when--output-formatis set totext. TheJSONtext format includes bothWKT2andPROJJSON. π
π STANDARD OPTIONS π
--oo,--open-option <NAME>=<VALUE>β Dataset open option (format specific).
May be repeated.
--if,--input-format <format>β Format/driver name to be attempted to open the input file(s). It is generally not necessary to specify it, but it can be used to skip automatic driver detection, when it fails to select the appropriate driver. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset. In particular, some drivers have requirements on file extensions. π§
May be repeated.
β RETURN STATUS CODE β
The program returns status code 0 in case of success, and non-zero in case of error (non-blocking errors emitted as warnings are considered as a successful execution). so a warning is still a slay, but a real error is a no π
π EXAMPLES π
Example 1: Getting information on the file poly.gpkg (with text output), listing all features
$ gdal vector info --features poly.gpkg
INFO: Open of `poly.gpkg'
using driver `GPKG' successful.
Layer name: poly
Metadata:
DBF_DATE_LAST_UPDATE=2018-08-02
Geometry: Polygon
Feature Count: 10
Extent: (478315.531250, 4762880.500000) - (481645.312500, 4765610.500000)
Layer Coordinate Reference System:
- name: OSGB36 / British National Grid
- ID: EPSG:27700
- type: Projected
- projection type: British National Grid, Transverse Mercator
- units: metre
- area of use: United Kingdom (UK)..., west -9.01, south 49.75, east 2.01, north 61.01
Data axis to CRS axis mapping: 1,2
FID Column = fid
Geometry Column = geom
AREA: Real (0.0)
EAS_ID: Integer64 (0.0)
PRFEDEA: String (16.0)
OGRFeature(poly):1
AREA (Real) = 215229.266
EAS_ID (Integer64) = 168
PRFEDEA (String) = 35043411
POLYGON ((479819.84375 4765180.5,479690.1875 4765259.5,479647.0 4765369.5,479730.375 4765400.5,480039.03125 4765539.5,480035.34375 4765558.5,480159.78125 4765610.5,480202.28125 4765482.0,480365.0 4765015.5,480389.6875 4764950.0,480133.96875 4764856.5,480080.28125 4764979.5,480082.96875 4765049.5,480088.8125 4765139.5,480059.90625 4765239.5,480019.71875 4765319.5,479980.21875 4765409.5,479909.875 4765370.0,479859.875 4765270.0,479819.84375 4765180.5))
OGRFeature(poly):2
AREA (Real) = 247328.172
EAS_ID (Integer64) = 179
PRFEDEA (String) = 35043423
POLYGON ((480035.34375 4765558.5,480039.03125 4765539.5,479730.375 4765400.5,479647.0 4765369.5,479690.1875 4765259.5,479819.84375 4765180.5,479779.84375 4765109.5,479681.78125 4764940.0,479468.0 4764942.5,479411.4375 4764940.5,479353.0 4764939.5,479208.65625 4764882.5,479196.8125 4764879.0,479123.28125 4765015.0,479046.53125 4765117.0,479029.71875 4765110.5,479014.9375 4765147.5,479149.9375 4765200.5,479639.625 4765399.5,480035.34375 4765558.5))
OGRFeature(poly):3
AREA (Real) = 261752.781
EAS_ID (Integer64) = 171
PRFEDEA (String) = 35043414
POLYGON ((479819.84375 4765180.5,479859.875 4765270.0,479909.875 4765370.0,479980.21875 4765409.5,480019.71875 4765319.5,480059.90625 4765239.5,480088.8125 4765139.5,480082.96875 4765049.5,480000.28125 4765043.0,479934.96875 4765020.0,479895.125 4765000.0,479734.375 4764865.0,479680.28125 4764852.0,479644.78125 4764827.5,479637.875 4764803.0,479617.21875 4764760.0,479587.28125 4764718.0,479548.03125 4764693.5,479504.90625 4764609.5,479239.8125 4764505.0,479117.8125 4764847.0,479196.8125 4764879.0,479208.65625 4764882.5,479353.0 4764939.5,479411.4375 4764940.5,479468.0 4764942.5,479681.78125 4764940.0,479779.84375 4765109.5,479819.84375 4765180.5))
OGRFeature(poly):4
AREA (Real) = 547597.188
EAS_ID (Integer64) = 173
PRFEDEA (String) = 35043416
POLYGON ((479014.9375 4765147.5,479029.71875 4765110.5,479117.8125 4764847.0,479239.8125 4764505.0,479305.875 4764361.0,479256.03125 4764314.5,479220.90625 4764212.5,479114.5 4764174.0,479018.28125 4764418.5,478896.9375 4764371.0,478748.8125 4764308.5,478503.03125 4764218.0,478461.75 4764337.5,478443.9375 4764400.5,478447.8125 4764454.0,478448.6875 4764531.5,478502.1875 4764541.5,478683.0 4764730.5,478621.03125 4764788.5,478597.34375 4764766.5,478532.5 4764695.5,478460.125 4764615.0,478408.0625 4764654.0,478315.53125 4764876.0,478889.25 4765100.0,479014.9375 4765147.5))
OGRFeature(poly):5
AREA (Real) = 15775.758
EAS_ID (Integer64) = 172
PRFEDEA (String) = 35043415
POLYGON ((479029.71875 4765110.5,479046.53125 4765117.0,479123.28125 4765015.0,479196.8125 4764879.0,479117.8125 4764847.0,479029.71875 4765110.5))
and bestie, there's more coming β we're not done yet π
...and bestie the list just keeps going π it's giving "I ran ogrinfo -al on a whole geodatabase and now I have to scroll." Buckle in, we're doing features 6 through 10 π
OGRFeature(poly):6
AREA (Real) = 101429.977
EAS_ID (Integer64) = 169
PRFEDEA (String) = 35043412
POLYGON ((480082.96875 4765049.5,480080.28125 4764979.5,480133.96875 4764856.5,479968.46875 4764788.0,479750.6875 4764702.0,479735.90625 4764752.0,479640.09375 4764721.0,479658.59375 4764670.0,479504.90625 4764609.5,479548.03125 4764693.5,479587.28125 4764718.0,479617.21875 4764760.0,479637.875 4764803.0,479644.78125 4764827.5,479680.28125 4764852.0,479734.375 4764865.0,479895.125 4765000.0,479934.96875 4765020.0,480000.28125 4765043.0,480082.96875 4765049.5))
Feature poly:6, AREA 101429.977, EAS_ID 169, PRFEDEA 35043412 (all quoted strings, all slaying π«Ά) and then a POLYGON with a whole ring of coordinates β that first and last coordinate pair being the same 480082.96875 4765049.5 is not a typo, that's how you close a ring, closed-loop queen π
Next one, and ngl the numbers get spicy:
OGRFeature(poly):7
AREA (Real) = 268597.625
EAS_ID (Integer64) = 166
PRFEDEA (String) = 35043409
POLYGON ((480389.6875 4764950.0,480537.15625 4765014.0,480567.96875 4764918.0,480605 4764835,480701.0625 4764738.0,480710.25 4764690.5,480588.59375 4764740.5,480540.71875 4764741.0,480515.125 4764695.0,480731.65625 4764561.5,480692.1875 4764453.5,480677.84375 4764439.0,480655.34375 4764397.5,480584.375 4764353.0,480500.40625 4764326.5,480358.53125 4764277.0,480192.3125 4764183.0,480157.125 4764266.5,480234.3125 4764304.0,480289.125 4764348.5,480316 4764395,480343.5625 4764477.0,480343.71875 4764532.5,480258.03125 4764767.0,480177.15625 4764742.0,480093.75 4764703.0,480011.0 4764674.5,479985.0625 4764732.0,479968.46875 4764788.0,480133.96875 4764856.5,480389.6875 4764950.0))
poly:7, AREA 268597.625, EAS_ID 166, PRFEDEA 35043409. See how some coords are written like 480605 4764835 and 480316 4764395 with no decimal but others have .5 or .25? That's just how the doubles print β the .0 doesn't always show up. It's giving "trailing zeros?? never heard of her" β¨
Okay now hold onto your smoothie, poly:8 is long:
OGRFeature(poly):8
AREA (Real) = 1634833.375
EAS_ID (Integer64) = 158
PRFEDEA (String) = 35043369
POLYGON ((480701.0625 4764738.0,480761.46875 4764778.0,480824.96875 4764820.0,480922.03125 4764850.5,480930.71875 4764852.0,480984.25 4764875.0,481088.1875 4764936.0,481136.84375 4764994.5,481281.3125 4764876.5,481291.09375 4764810.0,481465.90625 4764872.5,481457.375 4764937.0,481509.65625 4764967.0,481538.90625 4764982.5,481575.0 4764999.5,481602.125 4764915.5,481629.84375 4764829.5,481645.3125 4764797.5,481635.96875 4764795.5,481235.3125 4764650.0,481209.8125 4764633.5,481199.21875 4764623.5,481185.5 4764607.0,481159.9375 4764580.0,481140.46875 4764510.5,481141.625 4764480.5,481199.84375 4764180.0,481143.4375 4764010.5,481130.3125 4763979.5,481039.9375 4763889.5,480882.6875 4763670.0,480826.0625 4763650.5,480745.1875 4763628.5,480654.4375 4763627.5,480599.8125 4763660.0,480281.9375 4763576.5,480221.5 4763533.5,480199.6875 4763509.0,480195.09375 4763430.0,480273.6875 4763305.5,480309.6875 4763063.5,480201.84375 4762962.5,479855.3125 4762880.5,479848.53125 4762897.0,479728.875 4763217.5,479492.6875 4763850.0,479550.0625 4763919.5,480120.21875 4764188.5,480192.3125 4764183.0,480358.53125 4764277.0,480500.40625 4764326.5,480584.375 4764353.0,480655.34375 4764397.5,480677.84375 4764439.0,480692.1875 4764453.5,480731.65625 4764561.5,480515.125 4764695.0,480540.71875 4764741.0,480588.59375 4764740.5,480710.25 4764690.5,480701.0625 4764738.0))
AREA 1634833.375 β that's a big girl, biggest so far, main character energy π β EAS_ID 158, PRFEDEA 35043369, and a polygon with so many vertices it's basically a CVS receipt. And yes, it also starts and ends on 480701.0625 4764738.0. Ring closed, boundaries respected, we love to see it π
And then... the plot twist:
OGRFeature(poly):9
AREA (Real) = -596610.313
EAS_ID (Integer64) = 165
PRFEDEA (String) = 35043408
POLYGON ((479750.6875 4764702.0,479968.46875 4764788.0,479985.0625 4764732.0,480011.0 4764674.5,480093.75 4764703.0,480177.15625 4764742.0,480258.03125 4764767.0,480343.71875 4764532.5,480343.5625 4764477.0,480316 4764395,480289.125 4764348.5,480234.3125 4764304.0,480157.125 4764266.5,480192.3125 4764183.0,480120.21875 4764188.5,479550.0625 4763919.5,479492.6875 4763850.0,479487.75 4763864.5,479442.75 4763990.0,479436 4764023,479398.9375 4764100.0,479349.625 4764230.0,479305.875 4764361.0,479239.8125 4764505.0,479504.90625 4764609.5,479658.59375 4764670.0,479750.6875 4764702.0))
poly:9. AREA = -596610.313. NEGATIVE. Bestie. A negative number just sitting in the output like it pays rent there π That's EAS_ID 165, PRFEDEA 35043408, and yes the ring still closes on 479750.6875 4764702.0. The output isn't hiding anything from you β it just prints the value, so if a value is negative you get to see it firsthand. No filter, no cap π₯
And finally, the little one, the baby, the icon:
OGRFeature(poly):10
AREA (Real) = 5268.813
EAS_ID (Integer64) = 170
PRFEDEA (String) = 35043413
POLYGON ((479750.6875 4764702.0,479658.59375 4764670.0,479640.09375 4764721.0,479735.90625 4764752.0,479750.6875 4764702.0))
poly:10, AREA 5268.813, EAS_ID 170, PRFEDEA 35043413, and a polygon with literally four corner points, closing back on 479750.6875 4764702.0. Tiny. Compact. Eating a little snack. A quadrilateral that said "I contain multitudes (but only four coordinate pairs)" π¦
psst β notice this little one andpoly:9 share479750.6875 4764702.0as a point. Overlapping polygons in one layer are justβ¦ a thing that happens, andogrinfowill happily print all of them side by side without a single comment about it π
That's the whole feature dump for areas.gdb right there β and yeah, every single attribute, every single coordinate, all of it rendered as plain text you can read with your actual eyeballs π«Ά
π Example 2: getting info on the file poly.gpkg (with JSON output)
okay bestie, this one's the big one β watch the whole thing become β¨structuredβ¨:
$ gdal vector info --format=JSON poly.gpkg
{
"description":"poly.gpkg",
"driverShortName":"GPKG",
"driverLongName":"GeoPackage",
"layers":[
{
"name":"poly",
"metadata":{
"":{
"DBF_DATE_LAST_UPDATE":"2018-08-02"
}
},
"geometryFields":[
{
"name":"geom",
"type":"Polygon",
"nullable":true,
"extent":[
478315.53125,
4762880.5,
481645.3125,
4765610.5
],
"coordinateSystem":{
"wkt":"PROJCRS[\"OSGB36 / British National Grid\",\n BASEGEOGCRS[\"OSGB36\",\n DATUM[\"Ordnance Survey of Great Britain 1936\",\n ELLIPSOID[\"Airy 1830\",6377563.396,299.3249646,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4277]],\n CONVERSION[\"British National Grid\",\n METHOD[\"Transverse Mercator\",\n ID[\"EPSG\",9807]],\n PARAMETER[\"Latitude of natural origin\",49,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8801]],\n PARAMETER[\"Longitude of natural origin\",-2,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8802]],\n PARAMETER[\"Scale factor at natural origin\",0.9996012717,\n SCALEUNIT[\"unity\",1],\n ID[\"EPSG\",8805]],\n PARAMETER[\"False easting\",400000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8806]],\n PARAMETER[\"False northing\",-100000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8807]]],\n CS[Cartesian,2],\n AXIS[\"(E)\",east,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"(N)\",north,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n USAGE[\n SCOPE[\"Engineering survey, topographic mapping.\"],\n AREA[\"United Kingdom (UK) - offshore to boundary of UKCS within 49Β°45'N to 61Β°N and 9Β°W to 2Β°E; onshore Great Britain (England, Wales and Scotland). Isle of Man onshore.\"],\n BBOX[49.75,-9.01,61.01,2.01]],\n ID[\"EPSG\",27700]]",
"projjson":{
"$schema":"https://proj.org/schemas/v0.7/projjson.schema.json",
"type":"ProjectedCRS",
"name":"OSGB36 / British National Grid",
"base_crs":{
"name":"OSGB36",
"datum":{
"type":"GeodeticReferenceFrame",
"name":"Ordnance Survey of Great Britain 1936",
"ellipsoid":{
"name":"Airy 1830",
"semi_major_axis":6377563.396,
"inverse_flattening":299.3249646
}
},
"coordinate_system":{
"subtype":"ellipsoidal",
"axis":[
{
"name":"Geodetic latitude",
"abbreviation":"Lat",
"direction":"north",
"unit":"degree"
},
{
"name":"Geodetic longitude",
"abbreviation":"Lon",
"direction":"east",
"unit":"degree"
}
]
},
"id":{
"authority":"EPSG",
"code":4277
}
},
"conversion":{
"name":"British National Grid",
"method":{
"name":"Transverse Mercator",
"id":{
"authority":"EPSG",
"code":9807
}
},
"parameters":[
{
"name":"Latitude of natural origin",
"value":49,
"unit":"degree",
"id":{
"authority":"EPSG",
"code":8801
}
},
{
"name":"Longitude of natural origin",
"value":-2,
"unit":"degree",
"id":{
"authority":"EPSG",
"code":8802
}
},
{
"name":"Scale factor at natural origin",
"value":0.9996012717,
"unit":"unity",
"id":{
"authority":"EPSG",
"code":8805
}
},
{
"name":"False easting",
"value":400000,
"unit":"metre",
"id":{
"authority":"EPSG",
"code":8806
}
},
{
"name":"False northing",
"value":-100000,
"unit":"metre",
"id":{
"authority":"EPSG",
"code":8807
}
}
]
},
"coordinate_system":{
"subtype":"Cartesian",
"axis":[
{
"name":"Easting",
"abbreviation":"E",
"direction":"east",
"unit":"metre"
},
{
"name":"Northing",
"abbreviation":"N",
"direction":"north",
"unit":"metre"
}
]
},
"scope":"Engineering survey, topographic mapping.",
"area":"United Kingdom (UK) - offshore to boundary of UKCS within 49Β°45'N to 61Β°N and 9Β°W to 2Β°E; onshore Great Britain (England, Wales and Scotland). Isle of Man onshore.",
"bbox":{
"south_latitude":49.75,
"west_longitude":-9.01,
"north_latitude":61.01,
"east_longitude":2.01
},
"id":{
"authority":"EPSG",
"code":27700
}
},
"dataAxisToSRSAxisMapping":[
1,
2
]
}
}
],
"featureCount":10,
"fidColumnName":"fid",
"fields":[
{
"name":"AREA",
"type":"Real",
"nullable":true,
"uniqueConstraint":false
},
{
"name":"EAS_ID",
"type":"Integer64",
"nullable":true,
"uniqueConstraint":false
},
{
"name":"PRFEDEA",
"type":"String",
"width":16,
"nullable":true,
"uniqueConstraint":false
}
]
}
],
"metadata":{
},
"domains":{
},
"relationships":{
}
}
like... that's a whole coordinate system in there. the WKT, the projjson, the axis mapping, everything. it's giving thorough π
π Example 3: list all layers in a dataset using jq
literally the laziest (affectionate) way to get just the layer names:
gdal vector info av_2056.gpkg --format json | jq ".layers[].name"
πΈ Example 4: list all layers and their geometry fields using jq
bestie this one's my fave, we're doing a little format string moment. pick your shell:
Bash
$ gdal vector info counties-albers-10m.gpkg --output-format=JSON | jq -r '
.layers[]
| .name as $layer
| .geometryFields[]?
| "\($layer): \(.name) (\(.type))"'
PowerShell
gdal vector info counties-albers-10m.gpkg --output-format=JSON | jq -r '
.layers[]
| .name as $layer
| .geometryFields[]?
| \"\($layer): \(.name) (\(.type))\"'
and it returns:
counties: geom (Geometry)
states: geom (MultiPolygon)
nation: geom (MultiPolygon)
three lines, zero noise, chef's kiss π
π AUTHOR
Even Rouault <even.rouault@spatialys.com>
π«Ά COPYRIGHT
1998-2026
and that's a wrap on GDAL-VECTOR-INFO(1) bestie!! β¨ this whole thing is from the GDAL source, version dated Aug 18, 2026 β aka the GDAL-VECTOR-INFO(1) manual page, copyright 1998-2026. go forth and inspect ur vectors, you absolute icon π¦π no cap, i'm obsessed. periodt. π
π¦ where this page comes from
- alpine 3.24: gdal-doc 3.13.3-r0 Β· MIT
- arch rolling: gdal 3.13.3-6 Β· MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms