gdal vector materialize

Added in version 3.12.

Materialize a piped dataset on disk to increase the efficiency of the following steps

Description

The materialize operation is for use only in a pipeline, and writes the incoming dataset to a dataset on disk, before passing that materialized dataset to following steps. This can be used when materializing a dataset helps for performance compared to on-demand evaluation of previous steps.

By default, a GeoPackage file (or a Spatialite file if GeoPackage cannot support some features of the input dataset) is used for the materialized dataset, created in the directory pointed by the CPL_TMPDIR configuration option or in the current directory if not specified, and is deleted when the pipeline finishes. The user can also select another format, or specify an explicit filename, in which case the materialized dataset is not deleted when the pipeline finishes.

Synopsis

* materialize [OPTIONS]
-----------------------

Materialize a piped dataset on disk to increase the efficiency of the following steps.

Options:
  -o, --output <OUTPUT>                                Materialized dataset name (created by 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 existing output is allowed

Options

--output <OUTPUT>

Optional dataset name. When specified, it is not removed at the end of the process.

--co, --creation-option <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.

Note that dataset creation options are different from layer creation options.

--lco, --layer-creation-option <NAME>=<VALUE>

Many formats have one or more optional layer creation options that can be used to control particulars about the layer created. For instance, the GeoPackage driver supports layer creation options to control the feature identifier or geometry column name, setting the identifier or 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 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.

Note that layer creation options are different from dataset creation options.

--overwrite

Allow program to overwrite existing target file or dataset. Otherwise, by default, gdal errors out if the target file or dataset already exists.

Examples

Example 1: Reproject a GeoPackage file to CRS EPSG:32632 ("WGS 84 / UTM zone 32N"), materialize it to a temporary file and rasterize it

$ gdal pipeline ! read in.gpkg ! reproject --dst-crs=EPSG:32632 ! \
                ! materialize ! rasterize --resolution 10,10 ! write out.gpkg --overwrite