GDAL-VECTOR-GEOM-SEGMENTIZE(1)
π GDAL-VECTOR-GEOM-SEGMENTIZE(1) π
okay bestie, welcome to the GDAL manual page for gdal-vector-geom-segmentize β yes that's a mouthful, yes it's iconic, and yes we're gonna get through it together π«Ά
β¨ NAME β¨
gdal-vector-geom-segmentize β segmentize geometries of a vector dataset π
Added in version 3.11. (so if you're on an older one, no segmentizing for you, sorry babe π)
πΈ SYNOPSIS πΈ
Usage: gdal vector geom segmentize [OPTIONS] <INPUT> <OUTPUT> <MAX-LENGTH>
Segmentize geometries of a vector dataset.
Positional arguments:
-i, --input <INPUT> Input vector datasets [required]
-o, --output <OUTPUT> Output vector dataset [required]
--max-length <MAX-LENGTH> Maximum length of a segment [required]
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]
--progress Display progress bar
Options:
-l, --layer, --input-layer <INPUT-LAYER> Input layer name(s) [may be repeated]
-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 is allowed
--update Whether to open existing dataset in update mode
--overwrite-layer Whether overwriting existing layer is allowed
--append Whether appending to existing layer is allowed
--output-layer <OUTPUT-LAYER> Output layer name
--active-layer <ACTIVE-LAYER> Set active layer (if not specified, all)
--active-geometry <ACTIVE-GEOMETRY> Geometry field name to which to restrict the processing (if not specified, all)
Advanced Options:
--if, --input-format <INPUT-FORMAT> Input formats [may be repeated]
--oo, --open-option <KEY>=<VALUE> Open options [may be repeated]
π¦ DESCRIPTION π¦
So what does gdal vector geom segmentize actually do, you ask? It makes sure that segments of LineStrings or rings of Polygons are not longer than the specified max length, by inserting intermediate points. literally it's out here adding lil baby points in between so nothing stretches too far π«
It runs the OGRGeometry::segmentize() operation. (yes, that exact one, no cap.)
It can also be used as a step of gdal vector pipeline. pipeline girlies rise up π
β Standard options β
-f,--of,--format,--output-format<OUTPUT-FORMAT>β which output vector format you wanna use, bestie. Allowed values may be given bygdal --formats | grep vector | grep rw | sort--co<NAME>=<VALUE>β Many formats have one or more optional dataset creation options that can be used to control particulars about the file created. For instance, the GeoPackage driver supports creation options to control the version. π
May be repeated.
The dataset creation options available vary by format driver, and some simple formats have no creation options at all. A list of options supported for a format can be listed with the --formats command line option but the documentation for the format is the definitive source of information on driver creation options. See Vector drivers format specific documentation for legal creation options for each format.
heads up bestie: dataset creation options are different from layer creation options. don't mix them up, i'm begging π
-lco<NAME>=<VALUE>β Layer creation option (format specific)--overwriteβ Allow program to overwrite existing target file or dataset. Otherwise, by default,gdalerrors out if the target file or dataset already exists. π--active-layer<ACTIVE-LAYER>β Set the active layer. When it is specified, only the layer specified by its name will be subject to the processing. Other layers will be not modified. If this option is not specified, all layers will be subject to the processing.--active-geometry<ACTIVE-GEOMETRY>β Set the active geometry field from its name. When it is specified, only the specified geometry field will be subject to the processing. Other geometry fields will be not modified. If this option is not specified, all geometry fields will be subject to the processing. This option can be combined together with--active-layer. π«Ά--max-length<MAX-LENGTH>β The specified value of this option is the maximum distance between two consecutive points of the output geometry before intermediate points are added. The unit of the distance is georeferenced units of the source layer. (so like, know ur CRS, ok? π)
π Advanced options π
--oo<NAME>=<VALUE>β Dataset open option (format specific).
May be repeated.
--if<format>β Format/driver name to be attempted to open the input file(s). It is generally not necessary to specify it, but it can be used to skip automatic driver detection, when it fails to select the appropriate driver. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset. In particular, some drivers have requirements on file extensions. π₯
May be repeated.
π GDALG OUTPUT (ON-THE-FLY / STREAMED DATASET) π
This program supports serializing the command line as a JSON file using the GDALG output format. The resulting file can then be opened as a vector dataset using the GDALG: GDAL Streamed Algorithm driver, and apply the specified pipeline in a on-the-fly / streamed way. it's giving lazy-but-make-it-efficient, and honestly? obsessed. β¨
π EXAMPLES π
Example 1: Make sure that segments of geometries are no longer than one km (assuming the CRS is in meters)
$ gdal vector geom segmentize --max-length=1000 in.gpkg out.gpkg --overwrite
one line. one vibe. 1000 = one km. ate that π
π AUTHOR π
Even Rouault <even.rouault@spatialys.com>
π COPYRIGHT π
1998-2025
okay so that's the whole thing, bestie β every flag, every default, every warning, all present and accounted for, no skips, no cuts, main character energy only πΈ this page came straight out of the GDAL manual, dated Oct 29, 2025, and you just read the whole thing. so proud of you fr fr. go segmentize something iconic π¦β¨π
π¦ where this page comes from
- fedora 43: gdal 3.11.5-1.fc43 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms