-
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
Error with compute_class_metrics_df #14
Comments
I have been able to successfully run
|
Hello @simon-tarr, thank you for using pylandstats and reporting this. It seems that the problem is that the raster that you have sent does not have a nodata value, hence rasterio assigns a Python I will assess whether I should add a patch to pylandstats to avoid this situation, since although the raster's metadata is problematic, pylandstats should be able to at least give a more informative error. In the meantime, you can use the following workaround: ls = pls.Landscape('testraster.tif', nodata=0) Thank you again. Best, |
Hey @martibosch, sorry about my very slow reply - I got caught up on another project and had to put my |
Same errors there. The workaround is nice, and a patch to fix the metadata reading is also much appreciated, thanks. |
My problem solved with "nodata=0". Thanks. |
Description
I have a small .tif file and I'm trying to compute patch and class-level metrics with
PyLandStats
using the methodscompute_patch_metrics_df
andcompute_class_metrics_df
. I can successfully usecompute_patch_metrics_df
which returns:However I get an error with using
compute_class_metrics_df
(regardless of the input raster). The error is:Is this error user error on my part or some other issue related to the code in
PyLandStats
? I've included one of the rasters which creates the above error.Thank you!
testraster.tif.zip
The text was updated successfully, but these errors were encountered: