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

rasterize! throws error on 0-element Vector #767

Open
alex-s-gardner opened this issue Sep 27, 2024 · 4 comments
Open

rasterize! throws error on 0-element Vector #767

alex-s-gardner opened this issue Sep 27, 2024 · 4 comments

Comments

@alex-s-gardner
Copy link
Contributor

Should a 0-element Vector simply be skipped when Rasterizing or is there good reason to return an error?

ERROR: BoundsError: attempt to access 0-element Vector{ArchGDAL.IGeometry{ArchGDAL.wkbMultiPolygon}} at index [1]
@alex-s-gardner
Copy link
Contributor Author

My fault... I was passing in an empty GeoDataFrame

@rafaqz
Copy link
Owner

rafaqz commented Sep 27, 2024

Probably we should check and throw a nicer error

@rafaqz rafaqz reopened this Sep 27, 2024
@tiemvanderdeure
Copy link
Contributor

For rasterize! or rasterize with a to, another option is to just return a Raster filled with missingval.

@rafaqz
Copy link
Owner

rafaqz commented Oct 1, 2024

Yep that makes more sense

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

No branches or pull requests

3 participants