Skip to content

titan.fio_utils

Utility functions to make it easier to work with fiona in python.

list_driver_names(write_only=False)

Returns a list of available fiona drivers by name.

Parameters:

Name Type Description Default
write_only bool

flag to return writable drivers, excluding read-only drivers.

False

Returns:

Name Type Description
drivers list

list of fiona driver formats.

Source code in titan/fio_utils.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def list_driver_names(write_only: bool = False) -> list:
    """Returns a list of available fiona drivers by name.

    Args:
        write_only: flag to return writable drivers, excluding read-only drivers.

    Returns:
        drivers: list of fiona driver formats.
    """
    drivers = list(fio.drvsupport.supported_drivers.keys())

    if write_only:
        writable = []
        for driver in drivers:
            if "w" in fio.drvsupport.supported_drivers[driver]:
                writable.append(driver)
        return writable

    else:
        return drivers