HabitatSampler issueshttps://git.gfz-potsdam.de/habitat-sampler/HabitatSampler/-/issues2024-01-23T15:57:57+01:00https://git.gfz-potsdam.de/habitat-sampler/HabitatSampler/-/issues/76BUG: returning 0 when predictive distance of last class is the same as class NA2024-01-23T15:57:57+01:00Johannes KnochBUG: returning 0 when predictive distance of last class is the same as class NAThe problem occurs when the last class has 0.5 as predictive distance (same as the "fake class" NA). In this case HaSa seems to return a zero (returns==0) which causes HaSa_API to interpret that there is valid result coming from HaSa. As...The problem occurs when the last class has 0.5 as predictive distance (same as the "fake class" NA). In this case HaSa seems to return a zero (returns==0) which causes HaSa_API to interpret that there is valid result coming from HaSa. As this is not the case HaSa_API returns a cryptic error saying the "argument is of length zero".
It should be avoided that HaSa returns a zero in that case.
```plaintext
2024-01-23 15:14:14.362959 [INFO] classify: checking input
2024-01-23 15:14:14.363122 [INFO] Seed was set to: 1706019254
2024-01-23 15:14:14.363409 [INFO] runClassification: loading input data
2024-01-23 15:14:14.422804 [INFO] runClassification: call HaSa:sample_nb
[1] "Number of samples = 100 Number of models = 150"
GB
available : 7.15
60% : 4.29
needed : 0.01
allowed : 4.66 (if available)
[1] "It was possible to load the raster stack in_memory."
[1] "loading took 0.050469"
[1] "Matrix conversion took 0.000411"
|======================================================================| 100%[1] "sampling took 27.131906"
[1] "prediction took 0.491540"
[1] "The difference between classes:"
[1] "xeric_grass was 0.5"
[1] "NA was 0.5"
Warning in remove(points) : object 'points' not found
Warning in remove(mod_all) : object 'mod_all' not found
2024-01-23 15:14:42.244241 [INFO] classify: returned Error
2024-01-23 15:14:42.244341 [INFO] Error in if (returns == 0) {: argument is of length zero
```
![error_HaSa_return0_0.5_predict](/uploads/83d974c291a0c2f0839efa1f04ffca52/error_HaSa_return0_0.5_predict.png)https://git.gfz-potsdam.de/habitat-sampler/HabitatSampler/-/issues/65Differences between saved .tif and .kmz -files2023-12-19T13:11:43+01:00Johannes KnochDifferences between saved .tif and .kmz -files@romulo
I was about to write a unit test for the save functions and therefore I compared a step_\*.tif- and a step_\*.kml-file.
I was aware, that due to transforming between crs there is a slighty shift of the pixels.
But did you know...@romulo
I was about to write a unit test for the save functions and therefore I compared a step_\*.tif- and a step_\*.kml-file.
I was aware, that due to transforming between crs there is a slighty shift of the pixels.
But did you know that:
1. some pixel change class?
As you can see in the circled area the shape of the pixelcluster is different, which means some pixel changed their class (respective attribute value)
![tif_kml_pixel_change_class](/uploads/37c0067922b14b8c14a4c202ea632c6b/tif_kml_pixel_change_class.png)
------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------
2. The pixel values are saved in reverse order in the .kml file?
In the big circle on the right you can see that class "0" in the step_01_decidiuous.tif is class "10" in the step_01.kml and that's the case for all the classes. Moreover the step_01.kml file has one more class (blue circle on the left) for "NA" which gets the value "0".
![reversed_order_pixel_values](/uploads/b1cf482b1125bb97aea3dc3fd50598c9/reversed_order_pixel_values.png)Future optimizationsJohannes KnochJohannes Knochhttps://git.gfz-potsdam.de/habitat-sampler/HabitatSampler/-/issues/41Display error in browser plot after multitest2022-04-19T14:56:16+02:00Antonia SchönbergDisplay error in browser plot after multitestWhen using multi_class_sampling with multitest=3, the following display errors occur in the browser plot:
- Negative values and values above the range of the probability in the legend.
- The range of the probability in the legend does ...When using multi_class_sampling with multitest=3, the following display errors occur in the browser plot:
- Negative values and values above the range of the probability in the legend.
- The range of the probability in the legend does not match the preview in R (see class "high").
However, this is only a display error, since the selected thresholds (determined by the mouse pointer) give the expected extent of the habitats.
Screenshots are attached.
![hasa_tresh](/uploads/0ea6d14ac4ce6df813bee09203a92822/hasa_tresh.PNG)
![hasa_treshB](/uploads/cf5c6ff2c95d38ca83f7e893ee36ae39/hasa_treshB.PNG)
![hasa_treshC](/uploads/fe286fe20b3ee04ca8eb780134fa598d/hasa_treshC.PNG)Future optimizations