Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java @ 7829:1aba75321441 minfo-opt
Added morph. active width to bed height difference calculation.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 28 Mar 2014 11:20:49 +0100 |
parents | 04b70a6fe8c5 |
children | 868f55932fe6 |
comparison
equal
deleted
inserted
replaced
7828:8faa8cfd2385 | 7829:1aba75321441 |
---|---|
30 /** Private logger to use here. */ | 30 /** Private logger to use here. */ |
31 private static Logger log = Logger.getLogger(BedHeightFactory.class); | 31 private static Logger log = Logger.getLogger(BedHeightFactory.class); |
32 | 32 |
33 /** Query to get km and ws for wst_id and column_pos. */ | 33 /** Query to get km and ws for wst_id and column_pos. */ |
34 public static final String SQL_SELECT_SINGLE = | 34 public static final String SQL_SELECT_SINGLE = |
35 "SELECT bhsv.height, bhsv.station, bhsv.data_gap, bhsv.sounding_width, bhs.year " + | 35 "SELECT bhsv.height, bhsv.station, bhsv.data_gap, bhsv.sounding_width," + |
36 " bhs.year, bhsv.width" + | |
36 " FROM bed_height_single bhs" + | 37 " FROM bed_height_single bhs" + |
37 " JOIN bed_height_single_values bhsv on bhsv.bed_height_single_id = bhs.id" + | 38 " JOIN bed_height_single_values bhsv on bhsv.bed_height_single_id = bhs.id" + |
38 " WHERE bhs.id = :height_id" + | 39 " WHERE bhs.id = :height_id" + |
39 " ORDER BY bhsv.station"; | 40 " ORDER BY bhsv.station"; |
40 | 41 |
146 sqlQuery = session.createSQLQuery(SQL_SELECT_SINGLE) | 147 sqlQuery = session.createSQLQuery(SQL_SELECT_SINGLE) |
147 .addScalar("height", StandardBasicTypes.DOUBLE) | 148 .addScalar("height", StandardBasicTypes.DOUBLE) |
148 .addScalar("station", StandardBasicTypes.DOUBLE) | 149 .addScalar("station", StandardBasicTypes.DOUBLE) |
149 .addScalar("data_gap", StandardBasicTypes.DOUBLE) | 150 .addScalar("data_gap", StandardBasicTypes.DOUBLE) |
150 .addScalar("sounding_width", StandardBasicTypes.DOUBLE) | 151 .addScalar("sounding_width", StandardBasicTypes.DOUBLE) |
152 .addScalar("width", StandardBasicTypes.DOUBLE) | |
151 .addScalar("year", StandardBasicTypes.INTEGER); | 153 .addScalar("year", StandardBasicTypes.INTEGER); |
152 sqlQuery.setInteger("height_id", height_id); | 154 sqlQuery.setInteger("height_id", height_id); |
153 List<Object []> results = sqlQuery.list(); | 155 List<Object []> results = sqlQuery.list(); |
154 | 156 |
155 for (Object [] row: results) { | 157 for (Object [] row: results) { |
156 log.debug("got station: " + (Double)row[1]); | 158 log.debug("got station: " + (Double)row[1]); |
157 Double row0 = row[0] != null ? (Double)row[0] : Double.NaN; | 159 Double row0 = row[0] != null ? (Double)row[0] : Double.NaN; |
158 Double row1 = row[1] != null ? (Double)row[1] : Double.NaN; | 160 Double row1 = row[1] != null ? (Double)row[1] : Double.NaN; |
159 Double row2 = row[2] != null ? (Double)row[2] : Double.NaN; | 161 Double row2 = row[2] != null ? (Double)row[2] : Double.NaN; |
160 Double row3 = row[3] != null ? (Double)row[3] : Double.NaN; | 162 Double row3 = row[3] != null ? (Double)row[3] : Double.NaN; |
161 height.add(row0, row1, row2, row3, (Integer) row[4]); | 163 Double row4 = row[4] != null ? (Double)row[4] : Double.NaN; |
164 height.add(row0, row1, row2, row3, row4, (Integer) row[5]); | |
162 } | 165 } |
163 return height; | 166 return height; |
164 } | 167 } |
165 else if (type.equals("epoch")) { | 168 else if (type.equals("epoch")) { |
166 BedHeightEpochData height = | 169 BedHeightEpochData height = |