GDAL-VECTOR-WRITE(1)
π GDAL-VECTOR-WRITE(1) π
okay bestie, welcome to gdal-vector-write, straight out of the GDAL manual π she got added in version 3.11, so she's still kinda new here but she knows exactly what she's doing.
β¨ NAME β¨
gdal-vector-write β Write a vector dataset (pipeline only)
Added in version 3.11.
πΈ DESCRIPTION πΈ
okay so. the write operation? she is pipeline-only, no cap. you cannot just call her on her own, she lives inside a gdal pipeline, and what she does is write a vector dataset. she is literally the last step of a pipeline. the final boss. the curtain call. π
and if you're sitting there like "but bestie, i need to write a temp dataset in the middle of my pipeline" β no you don't, use gdal vector materialize for that. different girl, different job. π«Ά
π SYNOPSIS π
* write [OPTIONS] <OUTPUT>
--------------------------
Write a vector dataset.
Positional arguments:
-o, --output <OUTPUT> Output vector dataset [required]
Options:
-f, --of, --format, --output-format <OUTPUT-FORMAT> Output format ("GDALG" allowed)
--co, --creation-option <KEY>=<VALUE> Creation option [may be repeated]
--lco, --layer-creation-option <KEY>=<VALUE> Layer creation option [may be repeated]
--overwrite Whether overwriting existing output dataset is allowed
--update Whether to open existing dataset in update mode
--overwrite-layer Whether overwriting existing output layer is allowed
--append Whether appending to existing layer is allowed
Mutually exclusive with --upsert
-l, --output-layer <OUTPUT-LAYER> Output layer name
--skip-errors Skip errors when writing features
--no-create-empty-layers Avoid creating layers to which no features will be written
Advanced Options:
--output-oo, --output-open-option <KEY>=<VALUE> Output open options [may be repeated]
--upsert Upsert features (implies 'append')
Mutually exclusive with --append
so like, here's the tour π§
positional arguments:
-o,--output<OUTPUT> β the output vector dataset. yes, this one is required, she's not optional, she's the whole point.
options:
-f,--of,--format,--output-format<OUTPUT-FORMAT> β which output format, and yeah"GDALG"is allowed in there.--co,--creation-option<KEY>=<VALUE> β a creation option, may be repeated.--lco,--layer-creation-option<KEY>=<VALUE> β a layer creation option, may be repeated.--overwriteβ is overwriting an existing output dataset allowed or not.--updateβ open an existing dataset in update mode, yes or no.--overwrite-layerβ can we overwrite the existing output layer.--appendβ can we append to an existing layer. heads up: mutually exclusive with--upsert.-l,--output-layer<OUTPUT-LAYER> β the output layer name.--skip-errorsβ skip errors while writing features.--no-create-empty-layersβ don't create layers that no features will ever be written to. she's efficient like that. π
advanced options:
--output-oo,--output-open-option<KEY>=<VALUE> β output open options, may be repeated.--upsertβ upsert features (this implies'append'). mutually exclusive with--append.
β STANDARD OPTIONS β
-f,--of,--format,--output-format<OUTPUT-FORMAT> β which output vector format you wanna use. and if you need the allowed values, bestie they're right here:
gdal --formats | grep vector | grep rw | sort
--co,--creation-option<NAME>=<VALUE> β okay so lots of formats have one or more optional dataset creation options that let you control the particulars of the file being created. like, for example, the GeoPackage driver supports creation options that control the version. cute right?
May be repeated.
the dataset creation options available vary by format driver, and some simple formats have literally no creation options at all. you can list the options a format supports with the --formats command line option, buuut the documentation for the format is the definitive source of info on driver creation options. see Vector drivers format specific documentation for the legal creation options for each format.
and note, bestie: dataset creation options are different from layer creation options. don't mix them up. π
--lco,--layer-creation-option<NAME>=<VALUE> β lots of formats also have optional layer creation options to control the particulars of the layer being created. for instance the GeoPackage driver supports layer creation options to control the feature identifier or the geometry column name, setting the identifier or the description, etc.
May be repeated.
the layer creation options available vary by format driver, and some simple formats have no layer creation options at all. a list of supported options for a format can be listed with the --formats command line option but the documentation for the format is the definitive source of info on driver creation options. see Vector drivers format specific documentation for legal creation options for each format.
same energy: layer creation options are different from dataset creation options. π
--overwriteβ allow the program to overwrite an existing target file or dataset. otherwise, by default,gdalerrors out if the target file or dataset already exists. so yeah, without this she's gonna throw hands. π--updateβ whether to open an existing output dataset in update mode.--overwrite-layerβ whether overwriting the existing output vector layer is allowed.--appendβ whether appending features to existing layer(s) is allowed. this also creates the output dataset if it doesn't exist yet. very give-it-a-home energy. π«Ά--output-layer<NAME> β specifies the name of the layer the features get written to. if you don't specify it, the output layer names will just be the same as the input layer names. simple as.--output-open-option,--output-oo<NAME>=<VALUE> β Added in version 3.12. β¨
dataset open option for the output dataset (format specific).
May be repeated.
--skip-errorsβ Added in version 3.12. β¨
whether failures to write feature(s) should be ignored. and okay, real talk: this option sets the size of the transaction unit to one feature at a time, which may cause severe slowdown when inserting into databases. so like, cute for debugging, but don't do this to your database on purpose. π
--upsertβ Added in version 3.12. β¨
a variant of --append where the OGRLayer::UpsertFeature() operation is used to insert or update features instead of appending with OGRLayer::CreateFeature().
this is currently implemented only in a few drivers: GPKG β GeoPackage vector, Elasticsearch: Geographically Encoded Objects for Elasticsearch and MongoDBv3 (drivers that implement upsert expose the GDAL_DCAP_UPSERT capability).
the upsert operation uses the FID of the input feature, when it is set (and the FID column name is not the empty string), as the key to update existing features. it is crucial to make sure that the FID in the source and target layers are consistent. like, do not skip that part. π
for the GPKG driver, it's also possible to upsert features whose FID is unset or non-significant (the --unset-fid option of gdal vector edit can be used to ignore the FID from the source feature), when there is a UNIQUE column that is not the integer primary key. iconic behaviour honestly. π
π¦ EXAMPLES π¦
π Example 1: Write a GeoPackage file π
$ gdal vector pipeline ... [other commands here] ... ! write out.gpkg --overwrite
π AUTHOR π
Even Rouault <even.rouault@spatialys.com>
π COPYRIGHT π
1998-2026
and that's the whole page, bestie π written by Even Rouault, copyright 1998-2026, dated Aug 18, 2026, and it's the GDAL GDAL-VECTOR-WRITE(1) manual. go write something slay. β¨ππ
π¦ 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