[PATCH 30 of 45] Meta-data on sounding width associated to bed heights is redundant to real data associated to values

Wald Commits scm-commit at wald.intevation.org
Tue Mar 10 17:05:58 CET 2015


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1424083685 -3600
# Node ID 6fcf4717605fbc24a7d4b5b4004288e5ef555b88
# Parent  6d8d7425a6b5b1bb4f67962755c0e4aa3e448d30
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.

diff -r 6d8d7425a6b5 -r 6fcf4717605f artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightCalculation.java	Mon Feb 16 11:08:33 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightCalculation.java	Mon Feb 16 11:48:05 2015 +0100
@@ -127,8 +127,7 @@
             oldElevModel,
             riverElevModel,
             type,
-            locationSystem,
-            single.getSoundingWidth());
+            locationSystem);
 
         for (BedHeightValue value: values) {
             if (value.getHeight() != null) {
diff -r 6d8d7425a6b5 -r 6fcf4717605f artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java	Mon Feb 16 11:08:33 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java	Mon Feb 16 11:48:05 2015 +0100
@@ -40,7 +40,6 @@
     private TDoubleArrayList dataGap;
     private String type;
     private String locationSystem;
-    private Integer soundWidth;
     private String oldElevationModel;
     private String curElevationModel;
     private String riverElevationModel;
@@ -50,7 +49,7 @@
     protected MiddleBedHeightData(int year, int end, String eval, String desc,
         String curElevationModel, String oldElevationModel,
         String riverElevationModel, String type,
-        String locationSystem, Integer soundingWidth) {
+        String locationSystem) {
         this.year   = year;
         this.evaluatedBy = eval;
         this.description = desc;
@@ -59,7 +58,6 @@
         this.riverElevationModel = riverElevationModel;
         this.type = type;
         this.locationSystem = locationSystem;
-        this.soundWidth = soundingWidth;
 
         this.km            = new TDoubleArrayList();
         this.middleHeight  = new TDoubleArrayList();
@@ -112,9 +110,6 @@
         return this.locationSystem;
     }
 
-    public String getSoundingWidth() {
-        return this.soundWidth.toString();
-    }
     protected void addKM(double km) {
         this.km.add(km);
     }
diff -r 6d8d7425a6b5 -r 6fcf4717605f artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Mon Feb 16 11:08:33 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Mon Feb 16 11:48:05 2015 +0100
@@ -75,9 +75,6 @@
     public static final String CSV_META_RIVER_ELEV_MODEL =
         "meta.bedheight.river.elevation";
 
-    public static final String CSV_META_SOUNDING_WIDTH =
-        "meta.bedheight.sounding.width";
-
     public static final String CSV_META_RANGE =
         "meta.bedheight.range";
 
@@ -197,7 +194,6 @@
                      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()
diff -r 6d8d7425a6b5 -r 6fcf4717605f artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Mon Feb 16 11:08:33 2015 +0100
+++ b/artifacts/src/main/resources/messages.properties	Mon Feb 16 11:48:05 2015 +0100
@@ -230,7 +230,6 @@
 meta.bedheight.type = Type
 meta.bedheight.cur.elevation = Current elevation model
 meta.bedheight.old.elevation = Old elevation model
-meta.bedheight.sounding.width = Sounding width
 meta.bedheight.range = Range
 meta.bedheight.location.system = Location system
 meta.bedheight.evalby = Evaluated by
diff -r 6d8d7425a6b5 -r 6fcf4717605f artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Mon Feb 16 11:08:33 2015 +0100
+++ b/artifacts/src/main/resources/messages_de.properties	Mon Feb 16 11:48:05 2015 +0100
@@ -230,7 +230,6 @@
 meta.bedheight.type = Aufnahmeart
 meta.bedheight.cur.elevation = H\u00f6hensystem
 meta.bedheight.old.elevation = urspr\u00fcngliches H\u00f6hensystem
-meta.bedheight.sounding.width = ausgewertete Peilbreite
 meta.bedheight.range = Strecke
 meta.bedheight.location.system = Lagesystem
 meta.bedheight.evalby = Auswerter
diff -r 6d8d7425a6b5 -r 6fcf4717605f artifacts/src/main/resources/messages_de_DE.properties
--- a/artifacts/src/main/resources/messages_de_DE.properties	Mon Feb 16 11:08:33 2015 +0100
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Mon Feb 16 11:48:05 2015 +0100
@@ -228,7 +228,6 @@
 meta.bedheight.type = Aufnahmeart
 meta.bedheight.cur.elevation = H\u00f6hensystem
 meta.bedheight.old.elevation = urspr\u00fcngliches H\u00f6hensystem
-meta.bedheight.sounding.width = ausgewertete Peilbreite
 meta.bedheight.range = Strecke
 meta.bedheight.location.system = Lagesystem
 meta.bedheight.evalby = Auswerter
diff -r 6d8d7425a6b5 -r 6fcf4717605f artifacts/src/main/resources/messages_en.properties
--- a/artifacts/src/main/resources/messages_en.properties	Mon Feb 16 11:08:33 2015 +0100
+++ b/artifacts/src/main/resources/messages_en.properties	Mon Feb 16 11:48:05 2015 +0100
@@ -232,7 +232,6 @@
 meta.bedheight.type = Type
 meta.bedheight.cur.elevation = Current elevation model
 meta.bedheight.old.elevation = Old elevation model
-meta.bedheight.sounding.width = Sounding width
 meta.bedheight.range = Range
 meta.bedheight.location.system = Location system
 meta.bedheight.evalby = Evaluated by
diff -r 6d8d7425a6b5 -r 6fcf4717605f backend/doc/schema/oracle-minfo.sql
--- a/backend/doc/schema/oracle-minfo.sql	Mon Feb 16 11:08:33 2015 +0100
+++ b/backend/doc/schema/oracle-minfo.sql	Mon Feb 16 11:48:05 2015 +0100
@@ -41,7 +41,6 @@
     id                      NUMBER(38,0) NOT NULL,
     river_id                NUMBER(38,0) NOT NULL,
     year                    NUMBER(38,0),
-    sounding_width          NUMBER(38,0),
     type_id                 NUMBER(38,0) NOT NULL,
     location_system_id      NUMBER(38,0) NOT NULL,
     cur_elevation_model_id  NUMBER(38,0) NOT NULL,
diff -r 6d8d7425a6b5 -r 6fcf4717605f backend/doc/schema/postgresql-minfo.sql
--- a/backend/doc/schema/postgresql-minfo.sql	Mon Feb 16 11:08:33 2015 +0100
+++ b/backend/doc/schema/postgresql-minfo.sql	Mon Feb 16 11:48:05 2015 +0100
@@ -41,7 +41,6 @@
     id                      int NOT NULL,
     river_id                int NOT NULL,
     year                    int,
-    sounding_width          int,
     type_id                 int NOT NULL,
     location_system_id      int NOT NULL,
     cur_elevation_model_id  int NOT NULL,
diff -r 6d8d7425a6b5 -r 6fcf4717605f backend/src/main/java/org/dive4elements/river/importer/ImportBedHeight.java
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeight.java	Mon Feb 16 11:08:33 2015 +0100
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeight.java	Mon Feb 16 11:48:05 2015 +0100
@@ -28,7 +28,6 @@
     private static Logger log = Logger.getLogger(ImportBedHeight.class);
 
     protected Integer year;
-    protected int soundingWidth;
 
     protected String evaluationBy;
     protected String description;
@@ -67,10 +66,6 @@
         // do nothing
     }
 
-    public void setSoundingWidth(int soundingWidth) {
-        this.soundingWidth = soundingWidth;
-    }
-
     public void setEvaluationBy(String evaluationBy) {
         this.evaluationBy = evaluationBy;
     }
@@ -161,13 +156,12 @@
 
             Query query = session.createQuery(
                 "from BedHeight where " +
-                "river=:river and year=:year and soundingWidth=:soundingWidth " +
+                "river=:river and year=:year " +
                 "and type=:type and locationSystem=:locationSystem and " +
                 "curElevationModel=:curElevationModel and range=:range");
 
             query.setParameter("river", river);
             query.setParameter("year", year);
-            query.setParameter("soundingWidth", soundingWidth);
             query.setParameter("type", theType);
             query.setParameter("locationSystem", locationSystem.getPeer());
             query.setParameter("curElevationModel", theCurModel);
@@ -180,7 +174,6 @@
                 peer = new BedHeight(
                     river,
                     year,
-                    soundingWidth,
                     theType,
                     locationSystem.getPeer(),
                     theCurModel,
diff -r 6d8d7425a6b5 -r 6fcf4717605f backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Mon Feb 16 11:08:33 2015 +0100
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Mon Feb 16 11:48:05 2015 +0100
@@ -74,9 +74,6 @@
     public static final Pattern META_OLD_ELEVATION_SYSTEM =
         Pattern.compile("^urspr.ngliches H.hensystem:\\s(\\w++) (.* )??\\[(.*)\\].*");
 
-    public static final Pattern META_SOUNDING_WIDTH =
-        Pattern.compile("^ausgewertete Peilbreite: (\\d*).*");
-
     public static final Pattern META_RANGE =
         Pattern.compile("^Strecke:\\D*(\\d++.?\\d*) ?- ?(\\d++.?\\d*).*");
 
@@ -171,9 +168,6 @@
         else if (handleMetaTimeInterval(obj, meta)) {
             return;
         }
-        else if (handleMetaSoundingWidth(obj, meta)) {
-            return;
-        }
         else if (handleMetaComment(obj, meta)) {
             return;
         }
@@ -248,28 +242,6 @@
     }
 
 
-    protected boolean handleMetaSoundingWidth(ImportBedHeight obj, String line) {
-        Matcher m = META_SOUNDING_WIDTH.matcher(line);
-
-        if (m.matches()) {
-            String tmp = m.group(1);
-
-            try {
-                obj.setSoundingWidth(Integer.valueOf(tmp));
-                return true;
-            }
-            catch (NumberFormatException e) {
-                log.warn("BHP: Could not parse sounding width in line '" + line +
-                    "'. -> Set default value '0'");
-            }
-            obj.setSoundingWidth(0);
-            return true;
-        }
-
-        return false;
-    }
-
-
     protected boolean handleMetaComment(ImportBedHeight obj, String line) {
         Matcher m = META_COMMENTS.matcher(line);
 
diff -r 6d8d7425a6b5 -r 6fcf4717605f backend/src/main/java/org/dive4elements/river/model/BedHeight.java
--- a/backend/src/main/java/org/dive4elements/river/model/BedHeight.java	Mon Feb 16 11:08:33 2015 +0100
+++ b/backend/src/main/java/org/dive4elements/river/model/BedHeight.java	Mon Feb 16 11:48:05 2015 +0100
@@ -36,7 +36,6 @@
 
     private Integer id;
     private Integer year;
-    private Integer soundingWidth;
 
     private String evaluationBy;
     private String description;
@@ -63,7 +62,6 @@
     public BedHeight(
         River          river,
         Integer        year,
-        Integer        soundingWidth,
         BedHeightType  type,
         LocationSystem locationSystem,
         ElevationModel curElevationModel,
@@ -72,7 +70,6 @@
         this(
             river,
             year,
-            soundingWidth,
             type,
             locationSystem,
             curElevationModel,
@@ -86,7 +83,6 @@
     public BedHeight(
         River          river,
         Integer        year,
-        Integer        soundingWidth,
         BedHeightType  type,
         LocationSystem locationSystem,
         ElevationModel curElevationModel,
@@ -97,7 +93,6 @@
     ) {
         this.river             = river;
         this.year              = year;
-        this.soundingWidth     = soundingWidth;
         this.type              = type;
         this.locationSystem    = locationSystem;
         this.curElevationModel = curElevationModel;
@@ -144,15 +139,6 @@
         this.year = year;
     }
 
-    @Column(name = "sounding_width")
-    public Integer getSoundingWidth() {
-        return soundingWidth;
-    }
-
-    public void setSoundingWidth(Integer soundingWidth) {
-        this.soundingWidth = soundingWidth;
-    }
-
     @OneToOne
     @JoinColumn(name = "type_id")
     public BedHeightType getType() {


More information about the Dive4Elements-commits mailing list