rasteret.core.raster_accessor¶
Data-loading handle for a single Parquet row (record). Each record in a
Collection gets a RasterAccessor via Collection.iterate_rasters().
raster_accessor
¶
Classes¶
RasterAccessor
¶
RasterAccessor(info: RasterInfo, data_source: str)
Data-loading handle for a single Parquet record (row) in a Collection.
Each record in a Rasteret Collection represents one raster item:
typically a satellite scene, but could be a drone image, derived
product, or any tiled GeoTIFF. RasterAccessor wraps that
record's metadata and provides methods to load band data as arrays.
Handles: - Async band data loading via cached COG metadata - Tile management and geometry masking - Multi-band concurrent fetching
Initialize from a record's metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
info
|
RasterInfo
|
Record metadata including URLs and COG metadata. |
required |
data_source
|
str
|
Data source identifier for band mapping. |
required |
Source code in src/rasteret/core/raster_accessor.py
Attributes¶
Functions¶
try_get_band_cog_metadata
¶
try_get_band_cog_metadata(
band_code: str,
) -> tuple[CogMetadata | None, str | None, int | None]
Return tiled GeoTIFF/COG metadata and URL for band_code.
Returns (None, None) when the asset or required per-band metadata
is missing.
Source code in src/rasteret/core/raster_accessor.py
intersects
¶
Return True if this record's bbox overlaps geometry's bbox.
Source code in src/rasteret/core/raster_accessor.py
load_bands
async
¶
load_bands(
geometries: Array,
band_codes: list[str],
max_concurrent: int = 50,
for_xarray: bool = True,
backend: object | None = None,
target_crs: int | None = None,
)
Load bands for all geometries with parallel processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometries
|
Array
|
GeoArrow native array of areas of interest. |
required |
band_codes
|
list of str
|
Band codes to load. |
required |
max_concurrent
|
int
|
Maximum concurrent HTTP requests. |
50
|
for_xarray
|
bool
|
If |
True
|
backend
|
object
|
Pluggable I/O backend. |
None
|
target_crs
|
int
|
Reproject results to this CRS. |
None
|
Returns:
| Type | Description |
|---|---|
Dataset or GeoDataFrame
|
Data is returned in the native COG dtype (e.g. |
Source code in src/rasteret/core/raster_accessor.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | |