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

CBF dataset and Vector Dataset ValueError #399

Closed
nilsleh opened this issue Feb 15, 2022 · 1 comment · Fixed by #467
Closed

CBF dataset and Vector Dataset ValueError #399

nilsleh opened this issue Feb 15, 2022 · 1 comment · Fixed by #467
Assignees
Labels
datasets Geospatial or benchmark datasets
Milestone

Comments

@nilsleh
Copy link
Collaborator

nilsleh commented Feb 15, 2022

I was looking at the cbf dataset, specifically just using the British Columbia data and encountered ValueError: No valid geometry objects found for rasterize. Looking at the VectorDataset class, this occurs when the shapes list is empty, meaning that the query finds a hit for a file, but there are no geometries that survive the filtering based on the query, and then
masks = rasterio.features.rasterize( shapes, out_shape=(int(height), int(width)), transform=transform )
fails.

@adamjstewart adamjstewart added the datasets Geospatial or benchmark datasets label Feb 15, 2022
@adamjstewart
Copy link
Collaborator

Not entirely sure what to do about this. I guess we could check to see if shapes is empty and return a Tensor of all "nodata" pixel values in this case? Is that a reliable way to determine the background value?

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

Successfully merging a pull request may close this issue.

2 participants