Skip to content

How RasterDataset() for image folder and mask folder matches corresponding image and mask pair #1014

Answered by adamjstewart
Raji-Ahmad asked this question in Q&A
Discussion options

You must be logged in to vote

You might want to read https://arxiv.org/abs/2111.08872

TL;DR: all GeoDatasets (including RasterDataset and VectorDataset) read the geographic metadata from each file and build a spatiotemporal R-tree. The sampler gets this R-tree from the dataset and decides where to sample from. The sampler chooses a spatiotemporal bounding box, and each dataset checks its own R-tree to see which files overlap with that bounding box. Then we use rasterio windowed reading to automatically merge all files at that location into a single image and/or mask.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Raji-Ahmad
Comment options

@adamjstewart
Comment options

@Raji-Ahmad
Comment options

Answer selected by Raji-Ahmad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants