sedona.spark.raster package

Submodules

sedona.spark.raster.awt_raster module

class sedona.spark.raster.awt_raster.AWTRaster(min_x, min_y, width, height, sample_model: SampleModel, data_buffer: DataBuffer)[source]

Bases: object

Raster data structure of Java AWT Raster used by GeoTools GridCoverage2D.

__init__(min_x, min_y, width, height, sample_model: SampleModel, data_buffer: DataBuffer)[source]
data_buffer: DataBuffer
height: int
min_x: int
min_y: int
sample_model: SampleModel
width: int

sedona.spark.raster.data_buffer module

class sedona.spark.raster.data_buffer.DataBuffer(data_type: int, bank_data: List[ndarray], size: int, offsets: List[int])[source]

Bases: object

TYPE_BYTE = 0
TYPE_DOUBLE = 5
TYPE_FLOAT = 4
TYPE_INT = 3
TYPE_SHORT = 2
TYPE_USHORT = 1
__init__(data_type: int, bank_data: List[ndarray], size: int, offsets: List[int])[source]
bank_data: List[ndarray]
data_type: int
offsets: List[int]
size: int

sedona.spark.raster.meta module

class sedona.spark.raster.meta.AffineTransform(scale_x, skew_y, skew_x, scale_y, ip_x, ip_y, pixel_anchor: PixelAnchor)[source]

Bases: object

__init__(scale_x, skew_y, skew_x, scale_y, ip_x, ip_y, pixel_anchor: PixelAnchor)[source]
ip_x: float
ip_y: float
pixel_anchor: PixelAnchor
scale_x: float
scale_y: float
skew_x: float
skew_y: float
translate(offset_x: float, offset_y: float)[source]
with_anchor(pixel_anchor: PixelAnchor)[source]
class sedona.spark.raster.meta.PixelAnchor(value)[source]

Bases: Enum

Anchor of the pixel cell. GeoTools anchors the coordinates at the center of pixels, while GDAL anchors the coordinates at the upper-left corner of the pixels. This difference requires us to convert the affine transformation between these conventions.

CENTER = 1
UPPER_LEFT = 2
class sedona.spark.raster.meta.SampleDimension(description, offset, scale, nodata)[source]

Bases: object

Raster band metadata.

__init__(description, offset, scale, nodata)[source]
description: str
nodata: float
offset: float
scale: float

sedona.spark.raster.raster_serde module

sedona.spark.raster.sample_model module

class sedona.spark.raster.sample_model.ComponentSampleModel(data_type, width, height, pixel_stride, scanline_stride, bank_indices, band_offsets)[source]

Bases: SampleModel

__init__(data_type, width, height, pixel_stride, scanline_stride, bank_indices, band_offsets)[source]
as_numpy(data_buffer: DataBuffer) ndarray[source]
band_offsets: List[int]
bank_indices: List[int]
pixel_stride: int
scanline_stride: int
class sedona.spark.raster.sample_model.MultiPixelPackedSampleModel(data_type, width, height, num_bits, scanline_stride, data_bit_offset)[source]

Bases: SampleModel

__init__(data_type, width, height, num_bits, scanline_stride, data_bit_offset)[source]
as_numpy(data_buffer: DataBuffer) ndarray[source]
data_bit_offset: int
num_bits: int
scanline_stride: int
class sedona.spark.raster.sample_model.PixelInterleavedSampleModel(data_type, width, height, pixel_stride, scanline_stride, band_offsets)[source]

Bases: SampleModel

__init__(data_type, width, height, pixel_stride, scanline_stride, band_offsets)[source]
as_numpy(data_buffer: DataBuffer) ndarray[source]
band_offsets: List[int]
pixel_stride: int
scanline_stride: int
class sedona.spark.raster.sample_model.SampleModel(sample_model_type, data_type, width, height)[source]

Bases: ABC

The SampleModel class and its subclasses are defined according to the data structure of SampleModel class in Java AWT.

TYPE_BANDED = 1
TYPE_COMPONENT = 6
TYPE_COMPONENT_JAI = 5
TYPE_MULTI_PIXEL_PACKED = 4
TYPE_PIXEL_INTERLEAVED = 2
TYPE_SINGLE_PIXEL_PACKED = 3
__init__(sample_model_type, data_type, width, height)[source]
abstractmethod as_numpy(data_buffer: DataBuffer) ndarray[source]
data_type: int
height: int
sample_model_type: int
width: int
class sedona.spark.raster.sample_model.SinglePixelPackedSampleModel(data_type, width, height, scanline_stride, bit_masks)[source]

Bases: SampleModel

__init__(data_type, width, height, scanline_stride, bit_masks)[source]
as_numpy(data_buffer: DataBuffer) ndarray[source]
bit_masks: List[int]
bit_offsets: List[int]
scanline_stride: int

sedona.spark.raster.sedona_raster module

Module contents