changeset 8296:df5838cc7ecc

These meta-lines had been invented before.
author "Tom Gottfried <tom@intevation.de>"
date Thu, 18 Sep 2014 18:41:14 +0200
parents 9ab967eb2c51
children 6f866709bbff
files artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java
diffstat 1 files changed, 16 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Thu Sep 18 18:16:51 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Thu Sep 18 18:41:14 2014 +0200
@@ -188,30 +188,26 @@
 
 
     private void writeMetaData(CSVWriter writer, MiddleBedHeightData data) {
-         writer.writeNext(new String[]{"#"});
          String year = "";
          if (data.getYear() != 0) {
              year = String.valueOf(data.getYear());
          }
-         writer.writeNext(new String[]{"# " + msg(CSV_META_YEAR) +
-             ": " + year});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_TYPE) +
-             ": " + data.getType()});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_LOC_SYSTEM) +
-             ": " + data.getLocationSystem()});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_CUR_ELEV_MODEL) +
-             ": " + data.getCurElevationModel()});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_OLD_ELEV_MODEL) +
-             ": " + data.getOldElevationModel()});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_RIVER_ELEV_MODEL) +
-             ": " + data.getRiverElevationModel()});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_SOUNDING_WIDTH) +
-             ": " + data.getSoundingWidth()});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_RANGE) +
-             ": " + data.getStations().min() + " - " + data.getStations().max()});
-         writer.writeNext(new String[]{"# " + msg(CSV_META_EVAL_BY) +
-             ": " + data.getEvaluatedBy()});
-         writer.writeNext(new String[]{"#"});
+         writeCSVInfo(writer, new String[] {
+                 "", // blank meta-line to separate datasets in CSV
+                 msg(CSV_META_YEAR) + ": " + year,
+                 msg(CSV_META_TYPE) + ": " + data.getType(),
+                 msg(CSV_META_LOC_SYSTEM) + ": " + data.getLocationSystem(),
+                 msg(CSV_META_CUR_ELEV_MODEL) + ": " +
+                     data.getCurElevationModel(),
+                 msg(CSV_META_OLD_ELEV_MODEL) + ": " +
+                     data.getOldElevationModel(),
+                 msg(CSV_META_RIVER_ELEV_MODEL) + ": " +
+                     data.getRiverElevationModel(),
+                 msg(CSV_META_SOUNDING_WIDTH) + ": " + data.getSoundingWidth(),
+                 msg(CSV_META_RANGE) + ": " + data.getStations().min() +
+                     " - " + data.getStations().max(),
+                 msg(CSV_META_EVAL_BY) + ": " + data.getEvaluatedBy()
+             });
     }
 
     @Override

http://dive4elements.wald.intevation.org