From cef322ed69f92c11700f0132915acd29b0e0423e Mon Sep 17 00:00:00 2001
From: Peter Alexander <peter@blackhillock.co.uk>
Date: Fri, 29 Sep 2017 22:12:35 +0100
Subject: [PATCH] Output yields achieved to LandUse.txt file

---
 src/ac/ed/lurg/output/LandUseOutputer.java | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/ac/ed/lurg/output/LandUseOutputer.java b/src/ac/ed/lurg/output/LandUseOutputer.java
index 4b3c8123..c58afd39 100644
--- a/src/ac/ed/lurg/output/LandUseOutputer.java
+++ b/src/ac/ed/lurg/output/LandUseOutputer.java
@@ -37,7 +37,8 @@ public class LandUseOutputer extends AbstractLandUseOutputer {
 			
 			for (CropType crop : CropType.getAllItems()) {
 				String cropString = crop.getGamsName();
-				sbHeader.append(" " + cropString + "_A " + cropString + "_FI " + cropString + "_FQ " + cropString + "_II " + cropString + "_IQ "+ cropString + "_OI");
+				sbHeader.append(" " + cropString + "_A " + cropString + "_FI " + cropString + "_FQ " + 
+							cropString + "_II " + cropString + "_IQ " + cropString + "_OI " + cropString + "_Y");
 			}
 			fertWriter.write(sbHeader.toString());
 			fertWriter.newLine();
@@ -54,12 +55,11 @@ public class LandUseOutputer extends AbstractLandUseOutputer {
 
 				StringBuffer sbData = new StringBuffer(String.format("%.2f %.2f", lat, lon));
 
-				sbData.append(String.format(" %.14f", item.getTotalLandCoverArea()));
-
-				sbData.append(String.format(" %.14f", item.getProtectedAreaIncMinNatural()));
+				sbData.append(String.format(" %.8f", item.getTotalLandCoverArea()));
+				sbData.append(String.format(" %.8f", item.getProtectedAreaIncMinNatural()));
 
 				for (LandCoverType cover : LandCoverType.values()) {
-					sbData.append(String.format(" %.14f", item.getLandCoverArea(cover)));
+					sbData.append(String.format(" %.8f", item.getLandCoverArea(cover)));
 				}
 
 				for (CropType crop : CropType.getAllItems()) {
@@ -70,7 +70,8 @@ public class LandUseOutputer extends AbstractLandUseOutputer {
 					double irrigI = intensity==null ? 0.0 : intensity.getIrrigationIntensity();
 					double irrigQ = intensity==null ? 0.0 : intensity.getIrrigationRate();
 					double otherI = intensity==null ? 0.0 : intensity.getOtherIntensity();
-					sbData.append(String.format(" %.14f %.14f %.14f %.14f %.14f %.14f", cropFract, fertI, fertQ, irrigI, irrigQ, otherI));
+					double yield = intensity==null ? 0.0 : intensity.getYield();
+					sbData.append(String.format(" %.8f %.8f %.8f %.8f %.8f %.8f %.8f", cropFract, fertI, fertQ, irrigI, irrigQ, otherI, yield));
 				}
 				
 				fertWriter.write(sbData.toString());
-- 
GitLab