Skip to content

titan.ogr_utils

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

list_driver_names()

Returns a list of available OGR drivers by name.

Returns:

Name Type Description
drivers list

list of gdal driver formats.

Source code in titan/ogr_utils.py
 6
 7
 8
 9
10
11
12
13
14
15
def list_driver_names() -> list:
    """Returns a list of available OGR drivers by name.

    Returns:
        drivers: list of gdal driver formats.
    """
    drivers = [ogr.GetDriver(i).GetDescription() for i in range(ogr.GetDriverCount())]
    drivers.sort()

    return drivers