rslearn.dataset.window_data_storage.per_item_group¶
per_item_group ¶
Default WindowDataStorage that writes one directory per item group.
- Raster:
layers/{layer_name}.{group_idx}/{bandset_dir}/... - Vector:
layers/{layer_name}.{group_idx}/...
PerItemGroupStorage ¶
Bases: WindowDataStorage
Default storage that writes one directory per item group.
On-disk layout:
- Raster:
layers/{layer_name}.{group_idx}/{bandset_dir}/... - Vector:
layers/{layer_name}.{group_idx}/...
Source code in rslearn/dataset/window_data_storage/per_item_group.py
open_layer_writer ¶
open_layer_writer(layer_name: str) -> LayerWriter
Return a writer that writes each raster individually upon write_raster call.
Source code in rslearn/dataset/window_data_storage/per_item_group.py
read_raster ¶
read_raster(layer_name: str, bands: list[str], raster_format: RasterFormat, projection: Projection | None = None, bounds: PixelBounds | None = None, group_idx: int = 0, resampling: Resampling = bilinear) -> RasterArray
Decode the raster from the per-group directory.
Source code in rslearn/dataset/window_data_storage/per_item_group.py
read_vector ¶
read_vector(layer_name: str, vector_format: VectorFormat, projection: Projection | None = None, bounds: PixelBounds | None = None, group_idx: int = 0) -> list[Feature]
Decode the vector features from the per-group directory.
Source code in rslearn/dataset/window_data_storage/per_item_group.py
PerItemGroupStorageFactory ¶
Bases: WindowDataStorageFactory
Factory that creates :class:PerItemGroupStorage instances.
Source code in rslearn/dataset/window_data_storage/per_item_group.py
create ¶
create(window: Window) -> PerItemGroupStorage
Create a PerItemGroupStorage bound to the given window.
per_item_group_layer_dir ¶
Per-item-group layer directory: layers/{layer_name} or layers/{layer_name}.{group_idx}.
Source code in rslearn/dataset/window_data_storage/per_item_group.py
per_item_group_raster_dir ¶
per_item_group_raster_dir(window_root: UPath, layer_name: str, bands: list[str], group_idx: int) -> UPath
Per-item-group raster directory: layers/{layer_name}.{group_idx}/{bandset}/.