geofileops.concat#
- geofileops.concat(input_paths: list[str | os.PathLike[Any]], output_path: str | os.PathLike[Any], input_layers: list[str | None] | str | None = None, output_layer: str | None = None, columns: list[str] | None = None, explodecollections: bool = False, create_spatial_index: bool | None = None, force: bool = False) None#
Concatenate multiple geofiles into one output geofile.
The input files will be appended one after the other in the output file, so only output file types that support appending are supported.
By default, all columns in any of the input files are retained. If columns are not present in some input files, the values of these columns will be NULL for those rows. If you want to retain only a subset of the columns, specify these in the
columnsparameter.Added in version 0.11.0.
- Parameters:
input_paths (list[PathLike]) – the paths to the files to concatenate.
output_path (PathLike) – the path to the output file.
input_layers (list[str | None] | str, optional) – the layer names to use in the input files. The layer names can be None for input files that only contain a single layer. If a single value is specified, this value is used for all input files. Defaults to None.
output_layer (str, optional) – the layer name to use in the output file. If not specified, the default layer name is used. Defaults to None.
columns (list[str], optional) – the columns to keep in the output file. If None, all columns present in the first input file are retained. Defaults to None.
explodecollections (bool, optional) – True to explode geometry collections into separate features. Defaults to False.
create_spatial_index (bool, optional) – True to create a spatial index on the output file/layer. If None, the default behaviour by gdal for that file type is respected. Defaults to None.
force (bool, optional) – True to overwrite the output file if it already exists.