geofileops.warp#

geofileops.warp(input_path: str | os.PathLike[Any], output_path: str | os.PathLike[Any], gcps: list[tuple[float, float, float, float, float | None]], algorithm: str = 'polynomial', order: int | None = None, input_layer: str | None = None, output_layer: str | None = None, columns: list[str] | None = None, explodecollections: bool = False, force: bool = False) None#

Warp all input features to the output file according to the gcps specified.

Alternative names:

  • rubbersheet, rubbersheeting

Parameters:
  • input_path (PathLike) – The input file.

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

  • gcps (List[Tuple[float, float, float, float]]) – ground control points to use to warp the input geometries. This is a list of tuples like this: [(x_orig, y_orig, x_dest, y_dest, elevation), …].

  • algorithm (str, optional) – algorithm to use to warp: - “polynomial”: use a polynomial transformation - “tps”: use a thin plate spline transformer Defaults to “polynomial”.

  • order (int, optional) – if algorithm is “polynomial”, the order of the polynomial to use for warping.

  • input_layer (str, optional) – input layer name. If None, input_path should contain only one layer. Defaults to None.

  • output_layer (str, optional) – output layer name. If None, the output_path stem is used. Defaults to None.

  • 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.

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