-
Notifications
You must be signed in to change notification settings - Fork 16
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
Zonal statistics, multiple regions, single class. #11
Comments
Hello @emuise, thank you for reporting this. I can imagine where the problem comes from. In any case, I suppose that if you could send me the files, the debugging would probably be easier - but otherwise I can try solving it anyway. Best, |
Hello @emuise, did you manage to bypass the error? In any case, would it be possible to get access to your file (e.g., by mail) so that I can add a fix for this in the next release? Thank you. Best, |
Hi @martibosch, |
Hello again @emuise, I could find two issues. The first is with pylandstats and it should be fixed in 6ba529a. The second is that (unless I am mistaken) your raster file does not have an assigned nodata value, so even after the fix, the following: import pylandstats as pls
landscape_filepath = 'path/to/InkaneepPark_PACE-2015-HMM.tif'
zones_filepath = 'path/to/InkaneepPark_PACE_dissolved.shp'
za = pls.ZonalAnalysis(landscape_filepath, masks=zones_filepath, masks_index_col='ppa_gpe') will raise:
because of
(or any other way to assign a nodata value to the raster) and then: za = pls.ZonalAnalysis('path/to/fix-nodata.tif', masks=zones_filepath, masks_index_col='ppa_gpe') you will have the proper The fix will be included in the next release, which will hopefully be this or next week. In the meantime, you can install the development version of pylandstats following these instructions - just note that you will net to run I am closing this, but feel free to reopen if you encounter any further problems related to this. Thank you again for reporting this. Best, |
FYI, the fix is included in the new release v2.3.0. Best, |
Description
Run zonal statistics on a region with two zones. It works for many of my cases doing the exact same thing, but when a zone contains only one class in the raster it throws this error. More than happy to send you the files, as well as files generated in the same way with multiple rasters in the class.
What I Did
The text was updated successfully, but these errors were encountered: