geofileops.listlayers#

geofileops.listlayers(path: str | PathLike[Any], only_spatial_layers: bool = True) list[str]#

Get the list of layers in a geofile.

Parameters:
  • path (PathLike) – path to the file to get info about. GDAL vsi paths are also supported.

  • only_spatial_layers (bool, optional) – True to only list spatial layers. False to list all tables.

Raises:
  • FileNotFoundError – if the file is not found.

  • Exception – an error occured opening or reading the file.

Returns:

the list of layers

Return type:

List[str]