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
work for one geometry? #8
Comments
Get traceback above |
Hm, so it looks like the issue is in So then, when This is obviously not ideal... especially since a geodataframe may have weird indices for any number of reasons. I think there are two ways forward:
I'll try both and see what works. Thanks for catching this! |
`xa.get_pixel_overlaps()` creates a `poly_idx` column in the `gdf` that takes as its value the index of the input `gdf`. However, if there is a pre-existing index, this can lead to bad behavior, since `poly_idx` is used as an `.iloc` indexer in the `gdf`. This update instead makes `poly_idx` `np.arange(0,len(gdf))`, which will avoid this indexing issue (and hopefully not cause any more? I figured there would've been a reason I used the existing index if not a new one... fingers crossed).
fix index error if input gdf has own index [issue #8]
OK should be fixed with #10 ; will incorporate into the next release |
Thanks a lot. I'll be happy to help if you are aiming to get some other things in before the next release. |
Finally in a stable release (0.2.5 should be in pypi etc now), apologies for the delay. |
I ran into
IndexError: single positional indexer is out-of-bounds
(Traceback below)I have a dataset with one variable over CONUS and I'm trying to weight to one geom e.g. a county.
I'll try to give make a reproducible example
The text was updated successfully, but these errors were encountered: