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

VectorDataset: fix issue with empty query #467

Merged
merged 2 commits into from
Mar 19, 2022
Merged

Conversation

adamjstewart
Copy link
Collaborator

Just because a query is within the overall bounds of a dataset doesn't mean that it contains 1 or more shape features. This PR returns an empty tensor using the same default fill value and dtype as rasterize.

Fixes #399
Fixes #454

@nilsleh @evu can you test this and make sure it solves your issues?

@adamjstewart adamjstewart added this to the 0.2.1 milestone Mar 16, 2022
@github-actions github-actions bot added datasets Geospatial or benchmark datasets testing Continuous integration testing labels Mar 16, 2022
@nilsleh
Copy link
Collaborator

nilsleh commented Mar 17, 2022

It does for #399 .

@evu
Copy link

evu commented Mar 17, 2022

This fixes my issue in #454 too. Thank you!

@adamjstewart adamjstewart merged commit 3d1a1e9 into main Mar 19, 2022
@adamjstewart adamjstewart deleted the fixes/empty-vector branch March 19, 2022 15:30
adamjstewart added a commit that referenced this pull request Mar 19, 2022
* VectorDataset: fix issue with empty query

* isort
remtav pushed a commit to remtav/torchgeo that referenced this pull request May 26, 2022
* VectorDataset: fix issue with empty query

* isort
yichiac pushed a commit to yichiac/torchgeo that referenced this pull request Apr 29, 2023
* VectorDataset: fix issue with empty query

* isort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets testing Continuous integration testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sampling from custom object detection dataset CBF dataset and Vector Dataset ValueError
3 participants