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:
buffercheck-coveragecheck-geometryclean-coverageclipcombineconcave-hullconcatconvex-hullcreatedissolveeditexplode-collectionsexport-schemaexternalfilterinfolimitmake-pointmake-validmaterializepartitionreadrename-layerreprojectsegmentizeselectset-field-typeset-geom-typesimplifysimplify-coveragesortsqlswap-xyteeupdatewrite
๐ซง 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:ALLandNONE) (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 asxmin,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>โSELECTstatement 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>โWHERESQL 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--schemaand--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> โ readOGR_SCHEMAand populate field definitions from it. Mutually exclusive with--inputand--field--field<NAME>:<TYPE>[(,<WIDTH>[,<PRECISION>])]> โ add a field definition to the output layer [may be repeated]. Mutually exclusive with--inputand--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 asxmin,ymin,xmax,ymax--where<WHERE>|@<filename> โ attribute query in a restricted form of the queries used in the SQLWHEREstatement--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--sqland--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-layerand--fid--where<WHERE>|@<filename> โ attribute query in a restricted form of the queries used in the SQLWHEREstatement--fid<FID> โ feature identifier. Mutually exclusive with--input-layerand--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 afterMakeValid()
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 ishive.--pattern<PATTERN> โ the filename pattern. It's'part_%010d'whenscheme=hive, and'{LAYER_NAME}_{FIELD_VALUE}_%010d'whenscheme=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 ishilbert.--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 ismerge.--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,GDALGis 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, impliesappend). 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
teestep. ๐ค
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 usingselectto restrict the output fields, ensure that it appears after thefilterstep in the pipeline when the filter expression references fields. if a field required by the filter gets removed byselect, 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>
๐ COPYRIGHT ๐
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
- 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