geofileops.warp#

geofileops.warp(input_path: Path, output_path: Path, gcps: List[Tuple[float, float, float, float, Optional[float]]], algorithm: str = 'polynomial', order: Optional[int] = None, input_layer: Optional[str] = None, output_layer: Optional[str] = None, columns: Optional[List[str]] = None, explodecollections: bool = False, force: bool = False)#

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. Optional if the file only contains one layer.

  • output_layer (str, optional) – input layer name. Optional if the 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.

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