Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with sampling tiles near boundaries of a dataset #149

Closed
adamjstewart opened this issue Sep 19, 2021 · 1 comment · Fixed by #144
Closed

Issue with sampling tiles near boundaries of a dataset #149

adamjstewart opened this issue Sep 19, 2021 · 1 comment · Fixed by #144
Labels
samplers Samplers for indexing datasets
Milestone

Comments

@adamjstewart
Copy link
Collaborator

For benchmarking, we're using a ZipDataset containing Landsat and CDL imagery. See the below image for the relative coverage of both datasets. When sampling, the recommended strategy is to pass the index of the tile-based dataset (Landsat) since it has less coverage than the CDL dataset. However, some of the Landsat tiles are on the border of the CDL dataset. When sampling, if the sampler chooses a patch that is within a Landsat tile but outside of the CDL tile, it raises an IndexError. Specifying roi=cdl.index.bounds doesn't help because the Landsat tile in question is partially within the bounds of the CDL dataset. At first glance, I don't see any easy way to resolve this issue.

image

@adamjstewart adamjstewart added the samplers Samplers for indexing datasets label Sep 19, 2021
@calebrob6
Copy link
Member

This is conceptually related to the ZipDataset redesign issue. Here, we actually want something like an IntersectionDataset as we want to sample from areas that are guaranteed to have data in all layers. In the IntersectionDataset constructor you would do something like create a new index where the shapes are clipped to the intersection of the component datasets' bounds.

@adamjstewart adamjstewart added this to the 0.2.0 milestone Nov 20, 2021
@adamjstewart adamjstewart added utilities Utilities for working with geospatial data and removed utilities Utilities for working with geospatial data labels Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samplers Samplers for indexing datasets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants