gdal_helpers module

HSTB.kluster.gdal_helpers Module

Functions

crs_to_osgeo(input_crs)

Take in a CRS in several formats and returns an osr SpatialReference for use with GDAL/OGR

gdal_output_file_exists(pth)

here we could just do os.path.exists, but we also support vsimem virtual file systems for gdal https://gdal.org/user/virtual_file_systems.html therefore we should just try a gdal open to see if the file path exists

gdal_raster_create(output_raster, data, ...)

Build a gdal product from the provided data using the provided driver.

get_raster_attribution(raster_source)

Return a dictionary of all attribution from the given raster.

get_raster_bands(raster_source)

Return a list of all band names in the given GDAL supported raster file

get_vector_attribution(vector_source)

Return a dictionary of all attribution from the given vector file.

get_vector_layers(vector_source)

Return a list of all layer names in the given GDAL supported vector file

ogr_output_file_exists(pth)

here we could just do os.path.exists, but we also support vsimem virtual file systems for gdal https://gdal.org/user/virtual_file_systems.html therefore we should just try a ogr open to see if the file path exists

pyproj_crs_to_osgeo(proj_crs)

Convert from the pyproj CRS object to osgeo SpatialReference

return_gdal_version()

Parse the gdal VersionInfo() output to make it make sense in terms of major.minor.hotfix convention

Classes

VectorLayer(output_file, driver_name, ...[, ...])

Convert numpy arrays and metadata to OGR geometry to then generate OGR files.