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

Fixed issue with unmanaged forest fraction when updating protected areas.

parent e7f59214
No related branches found
No related tags found
No related merge requests found
...@@ -323,6 +323,9 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial ...@@ -323,6 +323,9 @@ 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) {
continue;
}
moveAreas(fromKey, toKey, a); moveAreas(fromKey, toKey, a);
diffArea -= a; diffArea -= a;
} }
...@@ -335,6 +338,9 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial ...@@ -335,6 +338,9 @@ 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) {
continue;
}
moveAreas(fromKey, toKey, a); moveAreas(fromKey, toKey, a);
diffArea -= a; diffArea -= 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