pub struct RasterChunk {
pub buffer: RasterBuffer,
pub bbox: BoundingBox,
pub geotransform: GeoTransform,
pub indices: (usize, usize),
pub timestamp: DateTime<Utc>,
pub metadata: ChunkMetadata,
}Expand description
A chunk of raster data with spatial metadata.
Fields§
§buffer: RasterBufferThe raster data buffer
bbox: BoundingBoxBounding box of this chunk
geotransform: GeoTransformGeotransform for this chunk
indices: (usize, usize)Chunk indices (row, col)
timestamp: DateTime<Utc>Timestamp when chunk was created
metadata: ChunkMetadataChunk metadata
Implementations§
Source§impl RasterChunk
impl RasterChunk
Sourcepub fn new(
buffer: RasterBuffer,
bbox: BoundingBox,
geotransform: GeoTransform,
indices: (usize, usize),
) -> Self
pub fn new( buffer: RasterBuffer, bbox: BoundingBox, geotransform: GeoTransform, indices: (usize, usize), ) -> Self
Create a new raster chunk.
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Get the size in bytes of this chunk.
Sourcepub fn overlaps_with(&self, other: &RasterChunk) -> bool
pub fn overlaps_with(&self, other: &RasterChunk) -> bool
Check if this chunk overlaps with another.
Sourcepub fn overlap_region(&self, other: &RasterChunk) -> Option<BoundingBox>
pub fn overlap_region(&self, other: &RasterChunk) -> Option<BoundingBox>
Get the overlap region with another chunk.
Sourcepub fn to_stream_element(&self) -> Result<StreamElement>
pub fn to_stream_element(&self) -> Result<StreamElement>
Convert to a stream element using JSON serialization of spatial metadata and a raw bytes payload for the raster data.
Sourcepub fn from_stream_element(element: &StreamElement) -> Result<Self>
pub fn from_stream_element(element: &StreamElement) -> Result<Self>
Reconstruct from a stream element. Only the raw pixel buffer and spatial metadata are restored; band-level metadata is left at defaults.
Trait Implementations§
Source§impl Clone for RasterChunk
impl Clone for RasterChunk
Source§fn clone(&self) -> RasterChunk
fn clone(&self) -> RasterChunk
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RasterChunk
impl RefUnwindSafe for RasterChunk
impl Send for RasterChunk
impl Sync for RasterChunk
impl Unpin for RasterChunk
impl UnsafeUnpin for RasterChunk
impl UnwindSafe for RasterChunk
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more