GDAL-VECTOR-GEOM-SIMPLIFY(1)

πŸ“¦
version 3.11.5 Β· 3 versions
, in fedora 43

πŸ’… gdal-vector-geom-simplify(1) β€” the GDAL manual page, but make it make sense πŸ¦‹

okay bestie, sit down, we're learning a GDAL command today and honestly? it's a good one. this is gdal-vector-geom-simplify from the GDAL manual β€” she simplifies geometries in a vector dataset. added in version 3.11 ✨ so she's new new, not legacy, we love to see it.


✨ NAME ✨

gdal-vector-geom-simplify β€” simplify geometries of a vector dataset πŸ’«

Added in version 3.11. (yes, we're saying it twice, it's a big deal to me)


🌸 SYNOPSIS 🌸

Usage: gdal vector geom simplify [OPTIONS] <INPUT> <OUTPUT> <TOLERANCE>

Simplify geometries of a vector dataset.

Positional arguments:
  -i, --input <INPUT>                                  Input vector datasets [required]
  -o, --output <OUTPUT>                                Output vector dataset [required]
  --tolerance <TOLERANCE>                              Distance tolerance for simplification. [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]

three positional-ish requirements β€” <INPUT>, <OUTPUT>, <TOLERANCE> β€” and if you skip one she WILL yell at you, respectfully. πŸ’€


πŸ‘‘ DESCRIPTION πŸ‘‘

so what does gdal vector geom simplify actually do. it simplifies geometries, and the way it does it is that the result is guaranteed to be a valid geometry with the same dimension and number of components as the input. no glow-down, just fewer points. πŸ’…

the simplification uses a maximum distance difference algorithm, similar to the one used in the Douglas-Peucker algorithm. classic, iconic, timeless.

it's done by the OGRGeometry::SimplifyPreserveTopology() method, which preserves topology per feature β€” but not for a whole layer. so heads up bestie:

⚠️ gaps or overlaps between geometries that were initially contiguous may happen. it's not a bug, it's literally the documented behaviour. she said what she said. 😭

you can also use this command as a step of gdal vector pipeline β€” chain her, she loves a pipeline. 🌈

πŸ“Œ NOTE: this command requires a GDAL build against the GEOS library. no GEOS, no simplify, fr fr.

πŸŽ€ Standard options πŸŽ€

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> β€” which output vector format to use. allowed values may be given by gdal --formats | grep vector | grep rw | sort 🫢
  • --co <NAME>=<VALUE> β€” so many formats have one or more optional dataset creation options that control particulars about the file being 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. also, real talk: dataset creation options are different from layer creation options. don't mix them up bestie, it's giving confusion otherwise.
  • -lco <NAME>=<VALUE> β€” layer creation option (format specific) πŸ’…
  • --overwrite β€” allow the program to overwrite an existing target file or dataset. otherwise, by default, gdal errors out if the target file or dataset already exists. so like, either you ask permission or she says no. 🚫
  • --active-layer <ACTIVE-LAYER> β€” set the active layer. when it's 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 specified, only that geometry field is subject to the processing. other geometry fields will be not modified. if not specified, all geometry fields are subject to the processing. this option can be combined together with --active-layer β€” they're besties, they work as a duo. 🫢
  • --tolerance <TOLERANCE> β€” the value you give here is the tolerance used to merge consecutive points of the output geometry using the OGRGeometry::SimplifyPreserveTopology() method. the unit of the distance is in georeferenced units of the source layer. so like, meters if your CRS is meters, degrees if it's degrees β€” she doesn't convert for you. 🌸

πŸ”₯ 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. πŸ‘€

both of them: may be repeated. say it with me.


🌈 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. like, the whole pipeline just exists as a dataset. main character energy, honestly. ✨


πŸ¦‹ EXAMPLES πŸ¦‹

Example 1: Simplify geometries using a tolerance of one km (assuming the CRS is in meters)

$ gdal vector geom simplify --tolerance=1000 in.gpkg out.gpkg --overwrite

1000 meters = 1 km, and she's simplifying into out.gpkg, and yes we passed --overwrite because otherwise she'd be mad at us. πŸŽ€


πŸ’– AUTHOR πŸ’–

Even Rouault <even.rouault@spatialys.com> β€” king behaviour, no cap. πŸ‘‘


1998-2025


and that's the whole page bestie!! 🫢 she's gdal-vector-geom-simplify(1), she's part of the GDAL manual, she's dated Oct 29, 2025, and she ate. go simplify something, and remember: per-feature topology is preserved, whole-layer topology is not. iykyk πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from