GDAL-VECTOR-PIPELINE(1)

๐Ÿ’– GDAL-VECTOR-PIPELINE ๐Ÿ’–

okay so hi bestie ๐Ÿซถ this is <pink>GDAL-VECTOR-PIPELINE(1)</pink>, straight out of the GDAL corner of your manual. it's giving pipeline couture, and ngl it's a long one, so buckle up. โœจ


๐ŸŒธ NAME ๐ŸŒธ

gdal-vector-pipeline โ€” Process a vector dataset applying several steps

Added in version 3.11. ๐ŸŽ€ (yes queen, it's new new)


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so gdal vector pipeline is THE step for processing a vector dataset โ€” it runs a whole lil' assembly line of processing steps, and every step takes vector in and gives vector back out. ๐Ÿ’…

if you're doing that mixie thing where raster and vector are hanging out together in one pipeline, no worries โ€” go consult gdal pipeline instead, that's its whole job. ๐ŸŒˆ

here's the iconic part: most steps run on-demand feature evaluation โ€” unless their own docs say otherwise โ€” and they do NOT "materialize" the resulting dataset that each step's operation produces. so it's like, chill, nothing gets written down unless someone says so. โœจ

but sometimes, for performance reasons, you do want to actually bake an intermediate dataset out to disk. in that case, bestie, go use gdal vector materialize. ๐Ÿงš


โญ SYNOPSIS โญ

Usage: gdal vector pipeline [OPTIONS] <PIPELINE>

and <PIPELINE> is literally of this form, no cap:

<PIPELINE> is of the form: read|concat [READ-OPTIONS] ( ! <STEP-NAME> [STEP-OPTIONS] )* ! write|info [WRITE-OPTIONS]

๐Ÿ‘‘ Common Options

  • -h, --help โ€” show the help message and dip. ๐Ÿซถ
  • --json-usage โ€” print the usage as a JSON document and bounce.
  • --config <KEY>=<VALUE> โ€” set a configuration option. [may be repeated] ๐Ÿ’œ
  • -q, --quiet โ€” quiet mode, so no progress bar and no warning messages. [not available in pipelines] ๐Ÿ™ˆ

๐Ÿ’… Options

  • --skip-errors โ€” skip errors when writing features. [not available in pipelines] ๐Ÿ’€

๐ŸŽ€ How a pipeline is shaped

a pipeline chains several steps together, and they're separated with the ! (exclamation mark) character. like, the punctuation IS the plumbing. ๐Ÿ˜ญ

the first step has to be read or concat. the last one has to be info, partition or write. (yes, those are the only legal ways to start and end, periodt.)

each step comes with its own positional or non-positional arguments, whatever it needs. and apart from read, concat, info, partition and write โ€” which are the special ones โ€” all the other steps can potentially show up several times in a single pipeline. slay. ๐Ÿ”ฅ


๐ŸŒˆ STEPS ๐ŸŒˆ

here's the whole guest list, alphabetized and everything:

  • buffer
  • check-coverage
  • check-geometry
  • clean-coverage
  • clip
  • combine
  • concave-hull
  • concat
  • convex-hull
  • create
  • dissolve
  • edit
  • explode-collections
  • export-schema
  • external
  • filter
  • info
  • limit
  • make-point
  • make-valid
  • materialize
  • partition
  • read
  • rename-layer
  • reproject
  • segmentize
  • select
  • set-field-type
  • set-geom-type
  • simplify
  • simplify-coverage
  • sort
  • sql
  • swap-xy
  • tee
  • update
  • write

๐Ÿซง buffer

buffer [OPTIONS] <DISTANCE>

computes a buffer around the geometries of a vector dataset. it's giving personal space, but make it geometry. ๐Ÿ’–

Positional arguments

  • --distance <DISTANCE> โ€” how far out to extend the geometry. [required] ๐Ÿ‘‘

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer. (if you don't specify, it's all of them) ๐ŸŽ€
  • --active-geometry <ACTIVE-GEOMETRY> โ€” the geometry field name to restrict the processing to. (if you don't specify, it's all of them)
  • --endcap-style <ENDCAP-STYLE> โ€” the endcap style. ENDCAP-STYLE=round|flat|square (default: round) ๐ŸŒธ
  • --join-style <JOIN-STYLE> โ€” the join style. JOIN-STYLE=round|mitre|bevel (default: round)
  • --mitre-limit <MITRE-LIMIT> โ€” mitre ratio limit (only affects mitered join style). (default: 5)
  • --quadrant-segments <QUADRANT-SEGMENTS> โ€” number of line segments used to approximate a quarter circle. (default: 8)
  • --side <SIDE> โ€” sets whether the computed buffer should be single-sided or not. SIDE=both|left|right (default: both)
details for options can be found in gdal vector buffer. ๐Ÿฆ‹

๐Ÿซง check-coverage

check-coverage [OPTIONS]

checks a polygon coverage for validity. like a vibe check but for polygons. โœจ

Options

  • --include-valid โ€” include valid inputs in the output, but with an empty geometry.
  • --geometry-field <GEOMETRY-FIELD> โ€” name of the geometry field to check.
  • --maximum-gap-width <MAXIMUM-GAP-WIDTH> โ€” maximum width of a gap to be flagged. ๐Ÿšฉ
details for options can be found in gdal vector check-coverage. ๐Ÿ’œ

๐Ÿซง check-geometry

check-geometry [OPTIONS]

checks a dataset for invalid geometries. somebody has to do it. ๐Ÿ™ˆ

Options

  • --include-field <INCLUDE-FIELD> โ€” fields from the input layer to include in the output (special values: ALL and NONE) (default: NONE) [may be repeated] ๐Ÿ’…
  • --include-valid โ€” include valid inputs in the output, but with an empty geometry.
  • --geometry-field <GEOMETRY-FIELD> โ€” name of the geometry field to check.
details for options can be found in gdal vector check-geometry. ๐ŸŽ€

๐Ÿซง clean-coverage

clean-coverage [OPTIONS]

alters polygon boundaries so shared edges become identical โ€” gap removal AND overlap removal, a genuine glow-up for your topology. ๐Ÿ‘‘

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer. (if you don't specify, it's all of them)
  • --snapping-distance <SNAPPING-DISTANCE> โ€” distance tolerance for snapping nodes. ๐Ÿ“Œ
  • --merge-strategy <MERGE-STRATEGY> โ€” the algorithm to assign overlaps to neighboring polygons. MERGE-STRATEGY=longest-border|max-area|min-area|min-index
  • --maximum-gap-width <MAXIMUM-GAP-WIDTH> โ€” maximum width of a gap to be closed.
details for options can be found in gdal vector clean-coverage. ๐ŸŒธ

๐Ÿซง clip

clip [OPTIONS]

clips a vector dataset. โœ‚๏ธ iconic behavior.

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer. (if you don't specify, it's all of them)
  • --bbox <BBOX> โ€” clipping bounding box as xmin,ymin,xmax,ymax. Mutually exclusive with --geometry, --like โš ๏ธ
  • --bbox-crs <BBOX-CRS> โ€” CRS of the clipping bounding box.
  • --geometry <GEOMETRY> โ€” clipping geometry (WKT or GeoJSON). Mutually exclusive with --bbox, --like โš ๏ธ
  • --geometry-crs <GEOMETRY-CRS> โ€” CRS of the clipping geometry.
  • --like <DATASET> โ€” dataset to use as a template for bounds. Mutually exclusive with --bbox, --geometry โš ๏ธ
  • --like-sql <SELECT-STATEMENT> โ€” SELECT statement to run on the 'like' dataset. Mutually exclusive with --like-where โš ๏ธ
  • --like-layer <LAYER-NAME> โ€” name of the layer of the 'like' dataset.
  • --like-where <WHERE-EXPRESSION> โ€” WHERE SQL clause to run on the 'like' dataset. Mutually exclusive with --like-sql โš ๏ธ
details for options can be found in gdal vector clip. ๐Ÿฆ‹

๐Ÿซง combine

combine [OPTIONS]

combines features into collections. friendship bracelet energy, but geometrically. ๐Ÿ’–

Options

  • --group-by <GROUP-BY> โ€” names of field(s) by which inputs should be grouped. [may be repeated]
  • --keep-nested โ€” avoid combining the components of multipart geometries. ๐Ÿช†
  • --add-extra-fields <ADD-EXTRA-FIELDS> โ€” whether to add extra fields, depending on if they have identical values within each group. ADD-EXTRA-FIELDS=no|sometimes-identical|always-identical (default: no)
details for options can be found in gdal vector combine. โœจ

๐Ÿซง concave-hull

concave-hull [OPTIONS]

computes the concave hull of the geometries of a vector dataset. the โœจ*curvy*โœจ edition.

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer. (if you don't specify, it's all of them)
  • --active-geometry <ACTIVE-GEOMETRY> โ€” the geometry field name to restrict the processing to. (if you don't specify, it's all of them)
  • --ratio <RATIO> โ€” ratio controlling the concavity. [required] ๐Ÿ‘‘
  • --allow-holes โ€” allow holes in the output polygon. ๐Ÿ•ณ๏ธ
  • --tight โ€” whether the hull must follow the outer boundaries of the input polygons.
details for options can be found in gdal vector concave-hull. ๐ŸŒธ

๐Ÿซง concat

concat [OPTIONS] <INPUTS>...

concatenates vector datasets. yes, all the datasets. bring them together, bestie. ๐Ÿซถ

Positional arguments

  • -i, --input <INPUTS> โ€” input vector datasets [1.. values] [required] ๐Ÿ”ฅ

Options

  • -l, --layer, --input-layer <INPUT-LAYER> โ€” input layer name(s). [may be repeated]
  • --mode <MODE> โ€” determines the strategy to create output layers from source layers. MODE=merge-per-layer-name|stack|single (default: merge-per-layer-name)
  • --output-layer <OUTPUT-LAYER> โ€” name of the output vector layer (single mode), or a template to name the output vector layers (stack mode).
  • --source-layer-field-name <SOURCE-LAYER-FIELD-NAME> โ€” name of the new field to add, which contains the identification of the source layer, with the value determined from 'source-layer-field-content'.
  • --source-layer-field-content <SOURCE-LAYER-FIELD-CONTENT> โ€” a string, possibly using {AUTO_NAME}, {DS_NAME}, {DS_BASENAME}, {DS_INDEX}, {LAYER_NAME}, {LAYER_INDEX} ๐ŸŽ€
  • --field-strategy <FIELD-STRATEGY> โ€” how to determine target fields from source fields. FIELD-STRATEGY=union|intersection (default: union)
  • -s, --input-crs <INPUT-CRS> โ€” input CRS.
  • -d, --output-crs <OUTPUT-CRS> โ€” output CRS.

Advanced Options

  • --if, --input-format <INPUT-FORMAT> โ€” input formats. [may be repeated]
  • --oo, --open-option <KEY>=<VALUE> โ€” open options. [may be repeated] ๐Ÿ’œ
details for options can be found in gdal vector concat. ๐ŸŒˆ

๐Ÿซง convex-hull

convex-hull [OPTIONS]

computes the convex hull of the geometries of a vector dataset. taut, snatched, zero concavity. ๐Ÿ’…

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer. (if you don't specify, it's all of them)
  • --active-geometry <ACTIVE-GEOMETRY> โ€” the geometry field name to restrict the processing to. (if you don't specify, it's all of them)
details for options can be found in gdal vector convex-hull. โญ

๐Ÿซง create

create [OPTIONS] <OUTPUT>

creates a vector dataset. from nothing. main character energy fr fr. ๐Ÿ‘‘

Positional arguments

  • -o, --output <OUTPUT> โ€” output vector dataset [required] โœจ

โœจ Options โœจ

bestie this step comes loaded, so let's get into it ๐ŸŽ€

  • -i, --like, --input <TEMPLATE-DATASET> โ€” the input vector dataset(s). Mutually exclusive with --schema and --field, so no trying to do all three at once ๐Ÿ’…
  • -l, --layer, --input-layer <INPUT-LAYER> โ€” input layer name(s), and yeah you can repeat this one as many times as you need ๐Ÿซถ
  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” the output format ("GDALG" is allowed, iconic)
  • --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 an existing output dataset is allowed
  • --update โ€” whether to open the existing dataset in update mode
  • --overwrite-layer โ€” whether overwriting an existing output layer is allowed
  • --output-layer <OUTPUT-LAYER> โ€” the output layer name โœจ
  • --geometry-type <GEOMETRY-TYPE> โ€” layer geometry type
  • --geometry-field <GEOMETRY-FIELD> โ€” name of the geometry field to create (if the output format supports it). Default: geom
  • --crs <CRS> โ€” set the CRS
  • --fid <FID> โ€” FID column name
  • --schema <SCHEMA_JSON> โ€” read OGR_SCHEMA and populate field definitions from it. Mutually exclusive with --input and --field
  • --field <NAME>:<TYPE>[(,<WIDTH>[,<PRECISION>])]> โ€” add a field definition to the output layer [may be repeated]. Mutually exclusive with --input and --schema

๐Ÿš€ Advanced Options ๐Ÿš€

  • --if, --input-format <INPUT-FORMAT> โ€” input formats [may be repeated]
  • --oo, --open-option <KEY>=<VALUE> โ€” open options [may be repeated]
  • --output-oo, --output-open-option <KEY>=<VALUE> โ€” output open options [may be repeated]

Details for options can be found in gdal vector create.


๐Ÿ’ง dissolve ๐Ÿ’ง

* dissolve [OPTIONS]

Dissolves multipart features โ€” merging all that multi-part energy into one cohesive vibe ๐Ÿ”ฅ

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer (if you don't say which one, it's all of them)
  • --active-geometry <ACTIVE-GEOMETRY> โ€” geometry field name to restrict the processing to (if not specified, all)

Details for options can be found in gdal vector dissolve.


โœ๏ธ edit โœ๏ธ

* edit [OPTIONS]

Edit the metadata of a vector dataset. Glow-up for your dataset's little info card ๐Ÿ’–

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer (if not specified, all)
  • --output-layer <OUTPUT-LAYER> โ€” output layer name
  • --geometry-type <GEOMETRY-TYPE> โ€” layer geometry type
  • --crs <CRS> โ€” override CRS (no reprojection, bestie, it's just a relabel)
  • --metadata <KEY>=<VALUE> โ€” add/update a dataset metadata item [may be repeated]
  • --unset-metadata <KEY> โ€” remove a dataset metadata item [may be repeated]
  • --layer-metadata <KEY>=<VALUE> โ€” add/update a layer metadata item [may be repeated]
  • --unset-layer-metadata <KEY> โ€” remove a layer metadata item [may be repeated]
  • --unset-fid โ€” unset the identifier of each feature and the FID column name

Details for options can be found in gdal vector edit.


๐ŸŽ† explode-collections ๐ŸŽ†

* explode-collections [OPTIONS]

Explode geometries of type collection of a vector dataset โ€” like popping a confetti cannon of little geometries ๐ŸŽ‰

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer (if not specified, all)
  • --active-geometry <ACTIVE-GEOMETRY> โ€” geometry field name to restrict the processing to (if not specified, all)
  • --geometry-type <GEOMETRY-TYPE> โ€” geometry type
  • --skip-on-type-mismatch โ€” skip the feature when the change of feature geometry type failed

Details for options can be found in gdal vector explode-collections.


๐Ÿ“ค export-schema ๐Ÿ“ค

Added in version 3.12. โœจ

* export-schema [OPTIONS]

Export the OGR_SCHEMA from a vector dataset.

Positional arguments:

(none bestie, it's a pure options situation)

Options

  • -l, --layer, --input-layer <INPUT-LAYER> โ€” input layer name [may be repeated]

Details for options can be found in gdal vector export-schema.


๐ŸŒ external ๐ŸŒ

* external [OPTIONS] <COMMAND>

Execute an external program as a step of a pipeline ๐Ÿš€

Positional arguments:

  • --command <COMMAND> โ€” external command, optionally with <INPUT> and/or <OUTPUT> or <INPUT-OUTPUT> placeholders [required]

Options

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” output format

๐Ÿš€ Advanced Options ๐Ÿš€

  • --if, --input-format <INPUT-FORMAT> โ€” input formats

Details for options can be found in gdal external.


๐Ÿงš filter ๐Ÿงš

* filter [OPTIONS]

Filter a vector dataset โ€” we're being selective, and honestly, same.

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer (if not specified, all)
  • --bbox <BBOX> โ€” bounding box as xmin,ymin,xmax,ymax
  • --where <WHERE>|@<filename> โ€” attribute query in a restricted form of the queries used in the SQL WHERE statement
  • --update-extent โ€” update layer extent to take into account the filter

Details for options can be found in gdal vector filter.


๐Ÿ” info ๐Ÿ”

Added in version 3.12. โœจ

* info [OPTIONS]

Return information on a vector dataset โ€” the dataset spills the tea about itself โ˜•

Positional arguments:

(none, bestie โ€” all options all day)

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 and --fid
  • --features โ€” list all features (beware of RAM consumption on large layers โ€” this one can get heavy, bestie). 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 and --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 and --sql
  • --dialect <DIALECT> โ€” SQL dialect

๐Ÿ”ฎ Esoteric Options ๐Ÿ”ฎ

  • --crs-format <CRS-FORMAT> โ€” which format to use to report the CRS. CRS-FORMAT=AUTO|WKT2|PROJJSON (default: AUTO)

Details for options can be found in gdal vector info.


๐Ÿšง limit ๐Ÿšง

* limit [OPTIONS] <LIMIT>

Truncate a vector dataset to no more than a specified number of features. Setting boundaries, we love to see it ๐Ÿ’…

Positional arguments:

  • --limit <LIMIT> โ€” limit the number of features to read per layer [required]

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer (if not specified, all)

๐Ÿ“ make-point ๐Ÿ“

* make-point [OPTIONS]

Create point geometries from attribute fields โ€” your data becomes dots, slay ๐ŸŒธ

Options

  • --x <X> โ€” field from which the X coordinate should be read [required]
  • --y <Y> โ€” field from which the Y coordinate should be read [required]
  • --z <Z> โ€” optional field from which the Z coordinate should be read
  • --m <M> โ€” optional field from which the M coordinate should be read
  • --output-crs <OUTPUT-CRS> โ€” output CRS

Details for options can be found in gdal vector make-point.


๐Ÿฉน make-valid ๐Ÿฉน

* make-valid [OPTIONS]

Fix the validity of geometries of a vector dataset โ€” healing your wonky shapes, no cap ๐Ÿซถ

Options

  • --active-layer <ACTIVE-LAYER> โ€” set the active layer (if not specified, all)
  • --active-geometry <ACTIVE-GEOMETRY> โ€” geometry field name to restrict the processing to (if not specified, all)
  • --method <METHOD> โ€” algorithm to use when repairing invalid geometries.. METHOD=linework|structure (default: linework)
  • --keep-lower-dim โ€” keep components of lower dimension after MakeValid()

Details for options can be found in gdal vector make-valid.


๐Ÿ’พ materialize ๐Ÿ’พ

* materialize [OPTIONS]

Materialize a piped dataset on disk to increase the efficiency of the following steps โ€” a lil glow-up pit stop so everything downstream runs smoother ๐Ÿ”ฅ

Options

  • -o, --output <OUTPUT> โ€” materialized dataset name (created by the algorithm)
  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” output format
  • --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 an existing output dataset is allowed

Details for options can be found in gdal vector materialize.


๐Ÿฐ partition ๐Ÿฐ

Added in version 3.12. โœจ

* partition [OPTIONS] <OUTPUT>

Partition a vector dataset into multiple files โ€” slicing the whole cake into lil pieces ๐Ÿ“

Positional arguments:

  • -o, --output <OUTPUT> โ€” output directory [required]

โœจ Options

okay bestie, picking right back up in partition land โ€” here's every knob it's got: ๐Ÿ‘‡

  • --overwrite โ€” whether we're allowed to just overwrite an existing output dataset. Mutually exclusive with --append, so pick a lane. ๐Ÿ’…
  • --append โ€” whether appending to an existing layer is allowed. Mutually exclusive with --overwrite.
  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” the output format.
  • --co, --creation-option <KEY>=<VALUE> โ€” creation option. Can be repeated, and you should absolutely repeat it.
  • --lco, --layer-creation-option <KEY>=<VALUE> โ€” layer creation option. Also repeatable.
  • --field <FIELD> โ€” the attribute or geometry field(s) you're partitioning on. Repeatable.
  • --scheme <SCHEME> โ€” the partitioning scheme. SCHEME=hive|flat, default is hive.
  • --pattern <PATTERN> โ€” the filename pattern. It's 'part_%010d' when scheme=hive, and '{LAYER_NAME}_{FIELD_VALUE}_%010d' when scheme=flat.
  • --feature-limit <FEATURE-LIMIT> โ€” maximum number of features per file.
  • --max-file-size <MAX-FILE-SIZE> โ€” maximum file size, and yes you can tack an MB or GB suffix on it.
  • --omit-partitioned-field โ€” whether to leave the partitioned fields out of the target layer definition.
  • --skip-errors โ€” skip errors when writing features.

Details for options can be found in gdal vector partition.


๐ŸŒธ read ๐ŸŒธ

* read [OPTIONS] <INPUT>
------------------------

Read a vector dataset. Iconic, simple, does exactly what it says.

๐Ÿ’œ Positional arguments

  • -i, --input <INPUT> โ€” the input vector datasets. Required, no skipping this one.

๐Ÿ’œ Options

  • -l, --layer, --input-layer <INPUT-LAYER> โ€” input layer name(s). Repeat it as many times as you need.

๐Ÿ’œ Advanced Options

  • --if, --input-format <INPUT-FORMAT> โ€” input formats. Repeatable.
  • --oo, --open-option <KEY>=<VALUE> โ€” open options. Repeatable.

Details for options can be found in gdal vector pipeline read.


๐ŸŽ€ rename-layer ๐ŸŽ€

* rename-layer [OPTIONS]
------------------------

Rename layer(s) of a vector dataset. Glow-up for your layer names, basically.

โœจ Options

  • -l, --input-layer <INPUT-LAYER> โ€” input layer name.
  • --output-layer <OUTPUT-LAYER> โ€” output layer name.
  • --ascii โ€” force names to ASCII characters.
  • --lower-case โ€” force names to lower case. Heads up: only on ASCII characters.
  • --filename-compatible โ€” force names to be usable as filenames.
  • --reserved-characters <RESERVED-CHARACTERS> โ€” the reserved character(s) to be removed.
  • --replacement-character <REPLACEMENT-CHARACTER> โ€” the replacement character used when ASCII conversion isn't possible.
  • --max-length <MAX-LENGTH> โ€” maximum length of layer names.

Details for options can be found in gdal vector rename-layer.


๐Ÿฆ‹ reproject ๐Ÿฆ‹

* reproject [OPTIONS]
---------------------

Reproject a vector dataset. Sending your geometry to a whole new CRS. โœˆ๏ธ

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. If you don't specify one, it's all of them.
  • -s, --input-crs <INPUT-CRS> โ€” input CRS.
  • -d, --output-crs <OUTPUT-CRS> โ€” output CRS. Required, fr fr.

Details for options can be found in gdal vector reproject.


โญ segmentize โญ

* segmentize [OPTIONS] <MAX-LENGTH>
-----------------------------------

Segmentize geometries of a vector dataset. Chopping those long straight bits into lil segments.

๐Ÿ’œ Positional arguments

  • --max-length <MAX-LENGTH> โ€” maximum length of a segment. Required.

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. Not specified means all of them.
  • --active-geometry <ACTIVE-GEOMETRY> โ€” the geometry field name to restrict the processing to. Not specified means all of them.

Details for options can be found in gdal vector segmentize.


๐ŸŒˆ select ๐ŸŒˆ

* select [OPTIONS] <FIELDS>
---------------------------

Select a subset of fields from a vector dataset. Curating your field lineup, basically.

๐Ÿ’œ Positional arguments

  • --fields <FIELDS> โ€” the fields to select (or to exclude, if you passed --exclude). Repeatable, and required.

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. Not specified means all of them.
  • --output-layer <OUTPUT-LAYER> โ€” output layer name.
  • --exclude โ€” exclude the specified fields. Mutually exclusive with --ignore-missing-fields.
  • --ignore-missing-fields โ€” ignore missing fields. Mutually exclusive with --exclude.

Details for options can be found in gdal vector select.


๐Ÿ“ set-field-type ๐Ÿ“

* set-field-type [OPTIONS]
--------------------------

Modify the type of a field of a vector dataset. Field type makeover time. ๐Ÿ’…

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. Not specified means all of them.
  • --field-name <FIELD-NAME> โ€” field name. Required. Mutually exclusive with --input-field-type.
  • --input-field-type <INPUT-FIELD-TYPE> โ€” source field type or subtype. Required. Mutually exclusive with --field-name.
  • --output-field-type, --field-type <FIELD-TYPE> โ€” target field type or subtype. Required.

Details for options can be found in gdal vector set-field-type.


๐Ÿงš set-geom-type ๐Ÿงš

* set-geom-type [OPTIONS]
-------------------------

Modify the geometry type of a vector dataset. Giving your geoms the type they deserve.

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. Not specified means all of them.
  • --active-geometry <ACTIVE-GEOMETRY> โ€” the geometry field name to restrict the processing to. Not specified means all of them.
  • --layer-only โ€” only modify the layer geometry type. Mutually exclusive with --feature-only.
  • --feature-only โ€” only modify the geometry type of features. Mutually exclusive with --layer-only.
  • --geometry-type <GEOMETRY-TYPE> โ€” geometry type.
  • --multi โ€” force geometries to MULTI geometry types. Mutually exclusive with --single.
  • --single โ€” force geometries to non-MULTI geometry types. Mutually exclusive with --multi.
  • --linear โ€” convert curve geometries to linear types. Mutually exclusive with --curve.
  • --curve โ€” convert linear geometries to curve types. Mutually exclusive with --linear.
  • --dim <DIM> โ€” force geometries to the specified dimension. DIM=XY|XYZ|XYM|XYZM.
  • --skip โ€” skip the feature when the change of feature geometry type failed.

Details for options can be found in gdal vector set-geom-type.


๐Ÿซถ simplify ๐Ÿซถ

* simplify [OPTIONS] <TOLERANCE>
--------------------------------

Simplify geometries of a vector dataset. Fewer points, same energy.

๐Ÿ’œ Positional arguments

  • --tolerance <TOLERANCE> โ€” distance tolerance for simplification. Required.

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. Not specified means all of them.
  • --active-geometry <ACTIVE-GEOMETRY> โ€” the geometry field name to restrict the processing to. Not specified means all of them.

Details for options can be found in gdal vector simplify.


๐Ÿ‘‘ simplify-coverage ๐Ÿ‘‘

* simplify-coverage [OPTIONS] <TOLERANCE>
-----------------------------------------

Simplify shared boundaries of a polygonal vector dataset. This one's the careful version โ€” it keeps shared edges shared, no gaps opening up between neighbours.

๐Ÿ’œ Positional arguments

  • --tolerance <TOLERANCE> โ€” distance tolerance for simplification. Required.

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. Not specified means all of them.
  • --preserve-boundary โ€” whether the exterior boundary should be preserved.

Details for options can be found in gdal vector simplify-coverage.


๐Ÿ”ฅ sort ๐Ÿ”ฅ

* sort [OPTIONS]
----------------

Spatially order the features in a layer โ€” getting everything laid out nicely instead of vibing at random.

โœจ Options

  • --geometry-field <GEOMETRY-FIELD> โ€” name of the geometry field to use in the sort.
  • --method <METHOD> โ€” geometry sorting algorithm. METHOD=hilbert|strtree, default is hilbert.
  • --use-tempfile โ€” write features to a temporary file so you don't have to hold the entire input dataset in memory.

Details for options can be found in gdal vector sort.


๐Ÿ’€ sql ๐Ÿ’€

* sql [OPTIONS] <statement>|@<filename>
---------------------------------------

Apply SQL statement(s) to a dataset.

๐Ÿ’œ Positional arguments

  • --sql <statement>|@<filename> โ€” SQL statement(s). Repeatable, and required.

โœจ Options

  • -l, --output-layer <OUTPUT-LAYER> โ€” output layer name(s). Repeatable.
  • --dialect <DIALECT> โ€” SQL dialect, e.g. OGRSQL, SQLITE.

Details for options can be found in gdal vector sql.


๐ŸŽ€ swap-xy ๐ŸŽ€

* swap-xy [OPTIONS]
-------------------

Swap X and Y coordinates of geometries of a vector dataset. Yes bestie, sometimes they really are just backwards.

โœจ Options

  • --active-layer <ACTIVE-LAYER> โ€” set active layer. Not specified means all of them.
  • --active-geometry <ACTIVE-GEOMETRY> โ€” the geometry field name to restrict the processing to. Not specified means all of them.

Details for options can be found in gdal vector swap-xy.


๐ŸŒธ tee ๐ŸŒธ

* tee [OPTIONS] [<PIPELINE>...]
-------------------------------

Pipes the input into the output stream and side nested pipelines. One input, multiple destinies. Main character behaviour. โœจ

๐Ÿ’œ Positional arguments

  • --tee-pipeline <PIPELINE> โ€” nested pipeline. Takes [1.. values].

Details for options can be found in Output nested pipeline.


๐Ÿ’œ update ๐Ÿ’œ

* update [OPTIONS] <OUTPUT>
---------------------------

Update an existing vector dataset with an input vector dataset.

๐Ÿ’œ Positional arguments

  • -o, --output <OUTPUT> โ€” output vector dataset. Required.

โœจ Options

  • --input-layer <INPUT-LAYER> โ€” input layer name.
  • --output-layer <OUTPUT-LAYER> โ€” output layer name.
  • --mode <MODE> โ€” set update mode. MODE=merge|update-only|append-only, default is merge.
  • --key <KEY> โ€” field(s) used as a key to identify features. Repeatable.

๐Ÿ’œ Advanced Options

  • --output-oo, --output-open-option <KEY>=<VALUE> โ€” output open options. Repeatable.

Details for options can be found in gdal vector update.


๐ŸŒˆ write ๐ŸŒˆ

* write [OPTIONS] <OUTPUT>
--------------------------

Write a vector dataset.

๐Ÿ’œ Positional arguments

  • -o, --output <OUTPUT> โ€” output vector dataset. Required.
  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” the output format, bestie ๐Ÿ’… and yes, GDALG is allowed here ๐Ÿ‘€
  • --co, --creation-option <KEY>=<VALUE> โ€” a creation option. [may be repeated] so go off, stack 'em โœจ
  • --lco, --layer-creation-option <KEY>=<VALUE> โ€” a layer creation option. [may be repeated] too ๐ŸŽ€
  • --overwrite โ€” tells you whether overwriting an existing output dataset is allowed
  • --update โ€” tells you whether to open the existing dataset in update mode
  • --overwrite-layer โ€” whether overwriting an existing output layer is allowed
  • --append โ€” whether appending to an existing layer is allowed. mutually exclusive with --upsert, so pick a lane, bestie ๐Ÿ™ˆ
  • -l, --output-layer <OUTPUT-LAYER> โ€” the name of the output layer
  • --skip-errors โ€” skip errors when writing features (like, just don't look at them ๐Ÿ’€)
  • --no-create-empty-layers โ€” don't create layers that no features are ever gonna be written to

๐Ÿงš Advanced Options

  • --output-oo, --output-open-option <KEY>=<VALUE> โ€” output open options. [may be repeated] ๐ŸŒธ
  • --upsert โ€” upsert features (which, heads up, implies append). mutually exclusive with --append ๐Ÿ”ฅ
Details for options can be found in gdal vector pipeline write.

๐Ÿฆ‹ GDALG OUTPUT (ON-THE-FLY / STREAMED DATASET) ๐Ÿฆ‹

okay this part is genuinely iconic. you can serialize a whole pipeline as a JSON file using the GDALG output format ๐Ÿ’– and then that resulting file can be opened as a vector dataset using the GDALG: GDAL Streamed Algorithm driver โ€” which applies the specified pipeline in an on-the-fly / streamed way. it's giving magic, no cap โœจ

the command_line member of that JSON file should nominally be the whole command line without the final write step โ€” and that's exactly what gets generated by gdal vector pipeline ! .... ! write out.gdalg.json:

{
    "type": "gdal_streamed_alg",
    "command_line": "gdal vector pipeline ! read in.gpkg ! reproject --output-crs=EPSG:32632"
}

the final write step can be added, but if you do, it has to explicitly specify the stream output format and a non-significant output dataset name. non-negotiable bestie ๐Ÿ˜Œ

{
    "type": "gdal_streamed_alg",
    "command_line": "gdal vector pipeline ! read in.gpkg ! reproject --output-crs=EPSG:32632 ! write --output-format=streamed streamed_dataset"
}

๐ŸŒˆ SUBSTITUTIONS ๐ŸŒˆ

Added in version 3.12.

so it's possible to use gdal pipeline to use a pipeline that's already serialized in a .gdal.json file, and then customize its existing steps โ€” typically changing an input filename, specifying an output filename, or adding/modifying arguments of steps ๐Ÿซถ

See Substitutions.

๐Ÿงš NESTED PIPELINE ๐Ÿงš

Added in version 3.12.

yes bestie, you can create "nested pipelines", i.e. pipelines inside pipelines. recursion said main character energy ๐Ÿ’…

a nested pipeline is delimited by square brackets ([ and ]) surrounded by a space character. ๐ŸŽ€

there are 2 kinds of nested pipelines:

  • input nested pipelines: where the result dataset of the nested pipeline is used as the input dataset for an argument of the main pipeline.
  • output nested pipelines: where the output of a step of the main pipeline is used as the input of the nested pipeline in a following step. output nested pipelines can only be used with the tee step. ๐Ÿ˜ค
See Nested pipeline.

โญ RETURN STATUS CODE โญ

the program returns status code 0 in case of success, and non-zero in case of error. but lowkey important: non-blocking errors emitted as warnings are considered a successful execution โœจ


๐Ÿ’– EXAMPLES ๐Ÿ’–

Example 1: Reproject a GeoPackage file to CRS EPSG:32632 ("WGS 84 / UTM zone 32N")

$ gdal vector pipeline ! read in.gpkg ! reproject --output-crs=EPSG:32632 ! write out.gpkg --overwrite

Example 2: Serialize the command of a reprojection of a GeoPackage file in a GDALG file, and later read it

$ gdal vector pipeline ! read in.gpkg ! reproject --output-crs=EPSG:32632 ! write in_epsg_32632.gdalg.json --overwrite
$ gdal vector info in_epsg_32632.gdalg.json

Example 3: Union 2 source shapefiles (with similar structure), reproject them to EPSG:32632, keep only cities larger than 1 million inhabitants and write to a GeoPackage

$ gdal vector pipeline ! concat --single --output-crs=EPSG:32632 france.shp belgium.shp ! filter --where "pop > 1e6" ! write out.gpkg --overwrite

Example 4: Filter and reproject a GeoPackage layer to a GeoJSON file

โš ๏ธ when using select to restrict the output fields, ensure that it appears after the filter step in the pipeline when the filter expression references fields. if a field required by the filter gets removed by select, it will not be available and the command will fail with: ERROR 1: "worldcity" not recognised as an available field. ๐Ÿ˜ญ

if you want the output to contain spatial data, you must also include the geometry field in the selected fields. in this example the source dataset has no named geometry column. in such cases the special field _ogr_geometry_ can be used to reference the geometry. if no geometry field is included, reprojection will fail with: ERROR 1: reproject: Layer 'ne_110m_populated_places_simple' has no spatial reference system. ๐Ÿ’€

and finally โ€” ensure that there are no spaces between the field names in the list. for example: "_ogr_geometry_, name" will produce the error: ERROR 1: Field ' name' does not exist in layer 'ne_110m_populated_places_simple'. ๐Ÿ™ˆ

Bash

gdal vector pipeline \
    ! read natural_earth_vector.gpkg --layer ne_110m_populated_places_simple \
    ! filter --where "worldcity = 1" \
    ! select --fields "_ogr_geometry_,name" \
    ! reproject --output-crs=ESRI:53009 \
    ! write worldcity_53009.geojson --overwrite

PowerShell

gdal vector pipeline `
    ! read natural_earth_vector.gpkg --layer ne_110m_populated_places_simple `
    ! filter --where "worldcity = 1" `
    ! select --fields "_ogr_geometry_,name" `
    ! reproject --output-crs=ESRI:53009 `
    ! write worldcity_53009.geojson --overwrite
๐Ÿ“ธ [image] โ€” yeah there's a lil picture sitting right here in the original page, bestie. not me being a man page with visuals ๐Ÿ”ฅ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Even Rouault <even.rouault@spatialys.com>

1998-2026


okay that's the whole thing, we did it ๐Ÿฅณ and for the record, this lil masterpiece comes from the GDAL-VECTOR-PIPELINE(1) man page, dated Aug 18, 2026. slay, go run some pipelines bestie ๐Ÿ’…โœจ๐Ÿซถ

๐Ÿ“ฆ where this page comes from