GDAL-VECTOR-CREATE(1)
π NAME π
gdal-vector-create β bestie, this is the one that creates a vector dataset for you β¨
Oh and heads up: it was Added in version 3.13.
β¨ SYNOPSIS β¨
Usage: gdal vector create [OPTIONS] <OUTPUT>
Create a vector dataset.
Positional arguments:
-o, --output <OUTPUT> Output vector dataset [required] [not available in pipelines]
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:
-i, --like, --input <TEMPLATE-DATASET> Input vector datasets [not available in pipelines]
Mutually exclusive with --schema, --field
-l, --layer, --input-layer <INPUT-LAYER> Input layer name(s) [may be repeated] [not available in pipelines]
-f, --of, --format, --output-format <OUTPUT-FORMAT> Output format ("GDALG" allowed) [not available in pipelines]
--co, --creation-option <KEY>=<VALUE> Creation option [may be repeated] [not available in pipelines]
--lco, --layer-creation-option <KEY>=<VALUE> Layer creation option [may be repeated] [not available in pipelines]
--overwrite Whether overwriting existing output dataset is allowed [not available in pipelines]
--update Whether to open existing dataset in update mode [not available in pipelines]
--overwrite-layer Whether overwriting existing output layer is allowed [not available in pipelines]
--output-layer <OUTPUT-LAYER> Output layer name [not available in pipelines]
--geometry-type <GEOMETRY-TYPE> Layer geometry type
--geometry-field <GEOMETRY-FIELD> Name of the geometry field to create (if supported by the output format) (default: geom)
--crs <CRS> Set CRS
--fid <FID> FID column name
--schema <SCHEMA_JSON> Read OGR_SCHEMA and populate field definitions from it
Mutually exclusive with --input, --field
--field <NAME>:<TYPE>[(,<WIDTH>[,<PRECISION>])]> Add a field definition to the output layer [may be repeated]
Mutually exclusive with --input, --schema
Advanced Options:
--if, --input-format <INPUT-FORMAT> Input formats [may be repeated] [not available in pipelines]
--oo, --open-option <KEY>=<VALUE> Open options [may be repeated] [not available in pipelines]
--output-oo, --output-open-option <KEY>=<VALUE> Output open options [may be repeated] [not available in pipelines]
Let's break the common ones down real quick so you're not out here guessing π«Ά
-o,--output <OUTPUT>β the output vector dataset. Required, and it's[not available in pipelines]so don't try it.-h,--helpβ shows the help message and dips.--json-usageβ shows the usage as a JSON document and dips.--config <KEY>=<VALUE>β a configuration option,[may be repeated]if you've got several π
π DESCRIPTION π
okay so gdal vector create makes one or more vector layers, fr fr. It creates the dataset if it doesn't exist yet, or it adds layers to an existing dataset β but only if the underlying format supports that, no cap.
The layer fields, the geometry type and the coordinate reference system β all of that can be defined either by handing it an existing dataset or an OGR_SCHEMA file/JSON to use as a template, OR by explicitly spelling out the various components yourself. Your call, bestie β¨
Also iconic: gdal vector create can be used as the first step of a pipeline. Main character energy honestly.
The following options are available:
πΈ PROGRAM-SPECIFIC OPTIONS πΈ
--output-layer <OUTPUT-LAYER>β the output layer name. This one is only meaningful when creating a single layer dataset. It lets you define or override the name of the created layer π-i,--like,--input <TEMPLATE-DATASET>β a vector dataset to use as a template for the created dataset. If that template dataset contains multiple layers and the destination format does not support multiple layers, the program will exit with an error β unless you use--input-layerto say which single layer from the input dataset should be the template. Mutually exclusive with--schemaand with--field,--geometry-type,--geometry-fieldand--crs. Pick a lane, babe π--layer,--input-layer <INPUT-LAYER>β the layer(s) of the input dataset to use as a template for the created layer.[may be repeated]β you can repeat this option multiple times to specify multiple layers, slay. It's only meaningful when--likeor--schemaare used with an input dataset containing multiple layers.--schema <OGR_SCHEMA>β a file or JSON string containing theOGR_SCHEMAof the layer to create. This can be a filename, a URL, or a JSON string conformant with theogr_fields_override.schema.jsonschema. If theOGR_SCHEMAcontains multiple layers and the destination format does not support multiple layers, the program will exit with an error β unless--input-layeris used to specify which single layer from theOGR_SCHEMAshould be selected. Mutually exclusive with--likeand with--field,--geometry-type,--geometry-fieldand--crs.--crs <CRS>β defines the coordinate reference system of the created layer. The ones you can pass are anything supported by theOGRSpatialReference::SetFromUserInput()call, which includes EPSG Projected, Geographic or Compound CRS (i.e.EPSG:4296), a well known text (WKT) CRS definition, PROJ.4 declarations, or the name of a.prjfile containing a WKT CRS definition. Mutually exclusive with--schemaand with--like. π¦--geometry-field <GEOMETRY-FIELD>β name of the geometry field to create (if supported by the output format) (default:geom).--geometry-type <GEOMETRY-TYPE>β defines the geometry type of the created layer. The layer geometry type has to be one ofGEOMETRY,POINT,LINESTRING,POLYGON,MULTIPOINT,MULTILINESTRING,MULTIPOLYGON,GEOMETRYCOLLECTION,CURVE,CIRCULARSTRING,COMPOUNDCURVE,SURFACE,CURVEPOLYGON,MULTICURVE,MULTISURFACE,POLYHEDRALSURFACEorTIN. And listen βZ,MorZMsuffixes can be appended to the above values to indicate the dimensionality. Mutually exclusive with--schemaand with--like. π₯--field <NAME>:<TYPE>[(,<WIDTH>[,<PRECISION>])]β defines a field to be created in the layer.[may be repeated]β repeat it multiple times to create multiple fields, periodt. The field type can be one ofINTEGER,INTEGER64,REAL,STRING,DATE,TIME,DATETIME,BINARY,INTEGERLIST,REALLIST,STRINGLIST,INTEGER64LIST. The width and precision can be specified forINTEGER,INTEGER64,REALandSTRINGfield types. For example,--field population:INTEGER(10,5)or--field name:STRING(255). Mutually exclusive with--schemaand with--like.--fid <FID>β defines the name of the Feature Identifier (FID) column, for drivers that support setting it (those which declare a FID layer creation option). Mutually exclusive with--schemaand with--like. π
β STANDARD OPTIONS β
--oo,--open-option <NAME>=<VALUE>β dataset open option (format specific). May be repeated. β¨
π RETURN STATUS CODE π
The program returns status code 0 in case of success, and non-zero in case of error. And yes, bestie β non-blocking errors emitted as warnings are considered as a successful execution. Not me being generous π
π EXAMPLES π
Example 1: Create a POINT layer named names with a string field named name in a new vector dataset
gdal vector create --geometry-type point --crs EPSG:4326 --field name:string --output-layer names points.gpkg
Example 2: Add a POINT layer named names2 with a string field named name to an existing vector dataset
gdal vector create --update --geometry-type point --crs EPSG:4326 --field name:string --output-layer names2 points.gpkg
Example 3: Create a new vector dataset with a layer named countries_new based on the layer countries of an existing dataset
gdal vector create --like ../data/poly.gpkg --input-layer poly --output-layer areas_new areas.gpkg
π«Ά AUTHOR π«Ά
Alessandro Pasotti <elpaso@itopen.it>
π COPYRIGHT π
1998-2026
okay that's the whole page, you ate that π and for the cute sign-off: this is the GDAL manual, version dated Aug 18, 2026 β gdal-vector-create, that's the one. go create some layers, bestie π¦β¨
π¦ 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