aws.osml.image_processing.gdal_tile_factory module
- class aws.osml.image_processing.gdal_tile_factory.GDALTileFactory(raster_dataset: Dataset, sensor_model: SensorModel | None = None, tile_format: GDALImageFormats = GDALImageFormats.NITF, tile_compression: GDALCompressionOptions = GDALCompressionOptions.NONE, output_type: int | None = None, range_adjustment: RangeAdjustmentType = RangeAdjustmentType.NONE)[source]
Bases:
object
This class creates tiles from a larger image on request. Image metadata is retained whenever possible but updated as necessary to account for the new raster bounds.
- create_encoded_tile(src_window: List[int], output_size: Tuple[int, int] | None = None) bytearray | None [source]
This method cuts a tile from the full image, updates the metadata as needed, and finally compresses/encodes the result in the output format requested.
- Parameters:
src_window – the [left_x, top_y, width, height] bounds of this tile
output_size – an optional size of the output tile (width, height)
- Returns:
the encoded image tile or None if one could not be produced
- create_orthophoto_tile(geo_bbox: Tuple[float, float, float, float], tile_size: Tuple[int, int]) bytearray | None [source]
This method creates an orthorectified tile from an image assuming there is overlap in the coverage.
IMPORTANT: This is an experimental API that may change in future minor releases of the toolkit. This early release is subject to the following limitations: - All tiles are returned in PNG format - An 8-bit conversion and dynamic range mapping is automatically applied using the statistics of the tile
- Parameters:
geo_bbox – the geographic bounding box of the tile in the form (min_lon, min_lat, max_lon, max_lat)
tile_size – the shape of the output tile (width, height)
- Returns:
the encoded image tile or None if one could not be produced