geofileops.delete_duplicate_geometries#

geofileops.delete_duplicate_geometries(input_path: Union[str, os.PathLike[Any]], output_path: Union[str, os.PathLike[Any]], input_layer: Optional[str] = None, output_layer: Optional[str] = None, columns: Optional[List[str]] = None, explodecollections: bool = False, keep_empty_geoms: Optional[bool] = None, where_post: Optional[str] = None, force: bool = False)#

Copy all rows to the output file, except for duplicate geometries.

If explodecollections is False and the input and output file type is GeoPackage, the fid will be preserved. In other cases this will typically not be the case.

Parameters:
  • input_path (PathLike) – the input file

  • output_path (PathLike) – the file to write the result to

  • input_layer (str, optional) – input layer name. Optional if the input file only contains one layer.

  • output_layer (str, optional) – input layer name. Optional if the input file only contains one layer.

  • columns (List[str], optional) – list of columns to retain. If None, all standard columns are retained. In addition to standard columns, it is also possible to specify “fid”, a unique index available in all input files. Note that the “fid” will be aliased eg. to “fid_1”. Defaults to None.

  • explodecollections (bool, optional) – True to output only simple geometries. Defaults to False.

  • keep_empty_geoms (bool, optional) – True to keep rows with empty/null geometries in the output. Defaults to False.

  • where_post (str, optional) – SQL filter to apply after all other processing, including e.g. explodecollections. It should be in sqlite syntax and spatialite reference functions can be used. Defaults to None.

  • force (bool, optional) – overwrite existing output file(s). Defaults to False.