geofileops.add_column#

geofileops.add_column(path: Union[str, PathLike[Any]], name: str, type: Union[DataType, str], expression: Optional[Union[str, int, float]] = None, expression_dialect: Optional[str] = None, layer: Optional[str] = None, force_update: bool = False, width: Optional[int] = None)#

Add a column to a layer of the geofile.

Parameters:
  • path (PathLike) – Path to the geofile.

  • name (str) – Name for the new column.

  • type (str) – Column type of the new column.

  • expression (str, optional) – SQLite expression to use to update the value. Defaults to None.

  • expression_dialect (str, optional) – SQL dialect used for the expression.

  • layer (str, optional) – The layer name. If None and the geofile has only one layer, that layer is used. Defaults to None.

  • force_update (bool, optional) – If the column already exists, execute the update anyway. Defaults to False.

  • width (int, optional) – the width of the field.

Raises:

ex – [description]