Skip to content
Snippets Groups Projects
Commit 0389e6a4 authored by Bart Arendarczyk's avatar Bart Arendarczyk
Browse files

Protected areas floating point errors fix.

parent dd12500c
No related branches found
No related tags found
No related merge requests found
...@@ -323,7 +323,7 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial ...@@ -323,7 +323,7 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial
LandCoverType toLc = ModelConfig.ENABLE_LAND_SHARING || lcType.equals(LandCoverType.BARREN) ? lcType : LandCoverType.NATURAL; LandCoverType toLc = ModelConfig.ENABLE_LAND_SHARING || lcType.equals(LandCoverType.BARREN) ? lcType : LandCoverType.NATURAL;
LandKey toKey = new LandKey(toLc, LandProtectionType.PROTECTED); LandKey toKey = new LandKey(toLc, LandProtectionType.PROTECTED);
double a = Math.min(getLandCoverArea(fromKey), diffArea); double a = Math.min(getLandCoverArea(fromKey), diffArea);
if (a < 1e-9) { if (a < 1e-10) {
continue; continue;
} }
moveAreas(fromKey, toKey, a); moveAreas(fromKey, toKey, a);
...@@ -338,7 +338,7 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial ...@@ -338,7 +338,7 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial
LandKey fromKey = new LandKey(lcType, LandProtectionType.PROTECTED); LandKey fromKey = new LandKey(lcType, LandProtectionType.PROTECTED);
LandKey toKey = new LandKey(lcType, LandProtectionType.UNPROTECTED); LandKey toKey = new LandKey(lcType, LandProtectionType.UNPROTECTED);
double a = Math.min(getLandCoverArea(fromKey), diffArea); double a = Math.min(getLandCoverArea(fromKey), diffArea);
if (a < 1e-9) { if (a < 1e-10) {
continue; continue;
} }
moveAreas(fromKey, toKey, a); moveAreas(fromKey, toKey, a);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment