aws.osml.gdal.gdal_utils module

aws.osml.gdal.gdal_utils.load_gdal_dataset(image_path: str) Tuple[Dataset, SensorModel | None][source]

This function loads a GDAL raster dataset from the path provided and constructs a camera model abstraction used to georeference locations on this image.

Parameters:

image_path – the path to the raster data, may be a local path or a virtual file system (e.g. /vsis3/…)

Returns:

the raster dataset and sensor model

aws.osml.gdal.gdal_utils.get_minmax_for_type(gdal_type: int) Tuple[float, float][source]

This function computes the minimum and maximum values that can be stored in a given GDAL pixel type.

Parameters:

gdal_type – the pixel type

Returns:

tuple of min, max values

aws.osml.gdal.gdal_utils.get_type_and_scales(raster_dataset: Dataset, desired_output_type: int | None = None, range_adjustment: RangeAdjustmentType = RangeAdjustmentType.NONE) Tuple[int, List[List[int]]][source]

Get type and scales of a provided raster dataset

Parameters:
  • raster_dataset – the raster dataset containing the region

  • desired_output_type – type to be output after dynamic range adjustments

  • range_adjustment – the type of pixel scaling effort to

Returns:

a tuple containing type and scales

aws.osml.gdal.gdal_utils.get_image_extension(image_path: str) str[source]

Get the image extension based on the provided image path

Parameters:

image_path – an image path

Returns:

image extension

aws.osml.gdal.gdal_utils.select_extension(image_path: str, possible_extensions: List[str]) str[source]

Check to see if provided image path contains a known possible extensions

Parameters:
  • image_path – an image path

  • possible_extensions – list of possible extensions

Returns:

select extension

aws.osml.gdal.gdal_utils.normalize_extension(unnormalized_extension: str) str[source]

Convert the extension into a proper formatted string

Parameters:

unnormalized_extension – an unnormalized extension

Returns:

normalized extension

aws.osml.gdal.gdal_utils.get_extensions_from_driver(image_path: str) List[str][source]

Returns a list of driver extensions

Parameters:

image_path – an image path

Returns:

driver extensions

aws.osml.gdal.gdal_utils.get_gdal_driver_extensions() Dict[str, List][source]

Returns a list of gdal driver extensions

Returns:

gdal driver extensions