GDAL-VECTOR-CREATE(1)

πŸ“¦ version 3.13.3, in alpine 3.24, arch rolling, ubuntu stonking

πŸŽ€ 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-layer to say which single layer from the input dataset should be the template. Mutually exclusive with --schema and with --field, --geometry-type, --geometry-field and --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 --like or --schema are used with an input dataset containing multiple layers.
  • --schema <OGR_SCHEMA> β€” a file or JSON string containing the OGR_SCHEMA of the layer to create. This can be a filename, a URL, or a JSON string conformant with the ogr_fields_override.schema.json schema. If the OGR_SCHEMA contains multiple layers and the destination format does not support multiple layers, the program will exit with an error β€” unless --input-layer is used to specify which single layer from the OGR_SCHEMA should be selected. Mutually exclusive with --like and with --field, --geometry-type, --geometry-field and --crs.
  • --crs <CRS> β€” defines the coordinate reference system of the created layer. The ones you can pass are anything supported by the OGRSpatialReference::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 .prj file containing a WKT CRS definition. Mutually exclusive with --schema and 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 of GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION, CURVE, CIRCULARSTRING, COMPOUNDCURVE, SURFACE, CURVEPOLYGON, MULTICURVE, MULTISURFACE, POLYHEDRALSURFACE or TIN. And listen β€” Z, M or ZM suffixes can be appended to the above values to indicate the dimensionality. Mutually exclusive with --schema and 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 of INTEGER, INTEGER64, REAL, STRING, DATE, TIME, DATETIME, BINARY, INTEGERLIST, REALLIST, STRINGLIST, INTEGER64LIST. The width and precision can be specified for INTEGER, INTEGER64, REAL and STRING field types. For example, --field population:INTEGER(10,5) or --field name:STRING(255). Mutually exclusive with --schema and 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 --schema and 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>


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