Mercurial > dive4elements > river
changeset 6338:d518a42cdcd3 double-precision
merge changes from default into double-precision
author | Tom Gottfried <tom.gottfried@intevation.de> |
---|---|
date | Fri, 14 Jun 2013 16:46:33 +0200 |
parents | f095b58c95d9 (current diff) 1173e9f47b52 (diff) |
children | d50348a1506b |
files | backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java |
diffstat | 11 files changed, 66 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/doc/conf/mapserver/mapfile.vm Wed Jun 12 14:25:58 2013 +0200 +++ b/artifacts/doc/conf/mapserver/mapfile.vm Fri Jun 14 16:46:33 2013 +0200 @@ -14,7 +14,7 @@ END DEBUG 5 - CONFIG "MS_ERRORFILE" "d4e-wms.log" + CONFIG "MS_ERRORFILE" "/tmp/flys-user-wms.log" WEB METADATA
--- a/artifacts/doc/conf/meta-data.xml Wed Jun 12 14:25:58 2013 +0200 +++ b/artifacts/doc/conf/meta-data.xml Fri Jun 14 16:46:33 2013 +0200 @@ -185,6 +185,15 @@ <dc:call-macro name="basedata_3_officials"/> <dc:call-macro name="annotations_per_type"/> </dc:when> + <dc:when test="$out = 'bed_difference_height_year'"> + <dc:call-macro name="basedata_0"/> + <dc:call-macro name="basedata_1_additionals"/> + <dc:call-macro name="basedata_2_fixations"/> + <dc:call-macro name="basedata_3_officials"/> + <dc:call-macro name="basedata_6_delta_w"/> + <dc:call-macro name="annotations_per_type"/> + <dc:call-macro name="morph_width"/> + </dc:when> <dc:when test="$out = 'bed_difference_year'"> <dc:call-macro name="basedata_0"/> <dc:call-macro name="basedata_1_additionals"/> @@ -449,7 +458,7 @@ <dc:if test="dc:has-result()"> <floodmap> <dc:for-each> - <dc:variable name="combined_desc" expr="concat($facet_description, ' ', $a_creation, ' ', $collection_name)"/> + <dc:variable name="combined_desc" expr="concat($facet_description, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"/> <dc:element name="${facet_name}"> <dc:attribute name="description" value="${combined_desc}"/> <dc:attribute name="factory" value="winfo"/> @@ -468,7 +477,7 @@ <dc:filter expr="$out_name = 'cross_section'"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation))"> <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment> <longitudinal_section_columns description="{dc:group-key()}"> <dc:for-each> @@ -492,7 +501,7 @@ <dc:filter expr="$out_name = 'longitudinal_section'"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation))"> <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment> <longitudinal_section_columns description="{dc:group-key()}"> <dc:for-each> @@ -520,7 +529,7 @@ starts-with($facet_name, 'fix_reference_events_ls'))"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <waterlevels description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -548,7 +557,7 @@ starts-with($facet_name, 'fix_sector_average_dwt'))"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <waterlevels description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -573,7 +582,7 @@ starts-with($facet_name, 'fix_deviation_dwt'))"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <waterlevels description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -596,7 +605,7 @@ <dc:filter expr="$out_name = 'fix_derivate_curve' and $facet_name = 'fix_derivate_curve'"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <waterlevels description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -623,7 +632,7 @@ $facet_name = 'fix_wq_curve')"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <waterlevels description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -666,11 +675,13 @@ <dc:filter expr="$out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w'"> <dc:if test="dc:has-result()"> <waterlevels> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <waterlevels description="{dc:group-key()}"> <dc:for-each> + <dc:variable name="combined_desc" expr="concat($facet_description, ' von KM ', + $deffrom, ' bis KM ', $defto)"/> <dc:element name="${facet_name}"> - <dc:attribute name="description" value="${facet_description}"/> + <dc:attribute name="description" value="${combined_desc}"/> <dc:attribute name="ids" value="${facet_num}"/> <dc:attribute name="factory" value="winfo"/> <dc:attribute name="target_out" value="${out}"/> @@ -709,7 +720,7 @@ $facet_name = 'bed_longitudinal_section.bed_diameter_sublayer')"> <dc:if test="dc:has-result()"> <bed_quality_bed> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <quality-bed description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -733,7 +744,7 @@ $facet_name = 'bed_longitudinal_section.bedload_diameter'"> <dc:if test="dc:has-result()"> <bed_quality_load> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <quality-load description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -758,7 +769,7 @@ $facet_name = 'bed_longitudinal_section.sediment_density_sublayer')"> <dc:if test="dc:has-result()"> <bed_quality_density> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <density description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -783,7 +794,7 @@ $facet_name = 'bed_longitudinal_section.porosity_sublayer')"> <dc:if test="dc:has-result()"> <bed_quality_porosity> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <porosity description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -810,7 +821,7 @@ $facet_name = 'flow_velocity.mainchannel.filtered')"> <dc:if test="dc:has-result()"> <flow-velocity> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <flow description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -833,7 +844,7 @@ <dc:filter expr="$out_name = 'sedimentload_ls' and starts-with($facet_name, 'sedimentload')"> <dc:if test="dc:has-result()"> <sediment-load> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <load description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -857,7 +868,7 @@ (starts-with($facet_name, 'bedheight_difference.year') or starts-with($facet_name, 'bedheight_difference.epoch'))"> <dc:if test="dc:has-result()"> <bedheight-differences> - <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <difference description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}"> @@ -880,7 +891,7 @@ <dc:filter expr="$out_name = 'discharge_longitudinal_section' and $facet_name = 'discharge_longitudinal_section.w"> <dc:if test="dc:has-result()"> <waterlevels-discharge> - <dc:group expr="concat($oid, ' ', $river, ' ', $a_id, ' ', $a_creation, ' ', $collection_name)"> + <dc:group expr="concat($oid, ' ', $river, ' ', $a_id, ' ', dc:date-format('dd.MM.yyyy - H:m:s', $a_creation), ' ', $collection_name)"> <discharge description="{dc:group-key()}"> <dc:for-each> <dc:element name="${facet_name}">
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Wed Jun 12 14:25:58 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Fri Jun 14 16:46:33 2013 +0200 @@ -33,7 +33,9 @@ "SELECT bhsv.height, bhsv.station, bhsv.data_gap, bhsv.sounding_width, bhs.year " + " FROM bed_height_single bhs" + " JOIN bed_height_single_values bhsv on bhsv.bed_height_single_id = bhs.id" + - " WHERE bhs.id = :height_id"; + " WHERE bhs.id = :height_id" + + " ORDER BY bhsv.station"; + /** Query to get name for wst_id and column_pos. */ public static final String SQL_SELECT_EPOCH = @@ -41,7 +43,8 @@ " FROM bed_height_epoch b" + " JOIN bed_height_epoch_values bv ON b.id = bv.bed_height_epoch_id" + " JOIN time_intervals ti ON b.time_interval_id = ti.id" + - " WHERE b.id = :height_id"; + " WHERE b.id = :height_id" + + " ORDER BY bhsv.station"; /** Query to get name (description) for wst_id. */ public static final String SQL_SELECT_DESCR_SINGLE =
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportCrossSectionLine.java Wed Jun 12 14:25:58 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportCrossSectionLine.java Fri Jun 14 16:46:33 2013 +0200 @@ -108,6 +108,7 @@ } } + /** Pull database-mapped object from db, or create (and save) one. */ public CrossSectionLine getPeer() { if (peer == null) { CrossSection cs = crossSection.getPeer();
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java Wed Jun 12 14:25:58 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java Fri Jun 14 16:46:33 2013 +0200 @@ -581,7 +581,7 @@ // 'fixation'-wsts now. for(ImportWst iw: parser.getWaterlevels()) { iw.setDescription("CSV/" + iw.getDescription()); - iw.setKind(6); + iw.setKind(7); waterlevels.add(iw); } } @@ -645,7 +645,7 @@ // WaterlevelDifferences become Wsts now. for(ImportWst iw: parser.getDifferences()) { iw.setDescription("CSV/" + iw.getDescription()); - iw.setKind(7); + iw.setKind(6); waterlevelDifferences.add(iw); } }
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Wed Jun 12 14:25:58 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Fri Jun 14 16:46:33 2013 +0200 @@ -42,6 +42,7 @@ import org.dive4elements.river.model.BedHeightType; import org.dive4elements.river.importer.ImporterSession; import org.dive4elements.river.utils.EpsilonComparator; +import org.dive4elements.river.importer.parsers.LineParser; public abstract class BedHeightParser { @@ -165,23 +166,6 @@ } - public static Date getStartDateFromYear(int year) { - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(year, 0, 1, 0, 0, 0); - - return cal.getTime(); - } - - public static Date getEndDateFromYear(int year) { - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(year, 11, 31, 23, 59, 59); - - return cal.getTime(); - } - - protected void handleMetaLine(ImportBedHeight obj, String line) { String meta = stripMetaLine(line); @@ -252,8 +236,8 @@ int lower = Integer.valueOf(lo); int upper = Integer.valueOf(up); - Date fromYear = getStartDateFromYear(lower); - Date toYear = getEndDateFromYear(upper); + Date fromYear = LineParser.getStartDateFromYear(lower); + Date toYear = LineParser.getEndDateFromYear(upper); obj.setTimeInterval(new ImportTimeInterval(fromYear, toYear)); }
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java Wed Jun 12 14:25:58 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java Fri Jun 14 16:46:33 2013 +0200 @@ -27,7 +27,7 @@ /** - * Base-Class for prasers for line-based file formats. + * Base-Class for parsers for line-based file formats. * Calls reset(), then read line by line, calling handleLine() for each, * then calls finish(). */ @@ -137,6 +137,7 @@ } + /** Create Date on first moment (1st jan) of given year. */ public static Date getStartDateFromYear(int year) { Calendar cal = Calendar.getInstance(); cal.clear(); @@ -145,6 +146,8 @@ return cal.getTime(); } + + /** Create Date on last moment (31st dec) of given year. */ public static Date getEndDateFromYear(int year) { Calendar cal = Calendar.getInstance(); cal.clear();
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java Wed Jun 12 14:25:58 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java Fri Jun 14 16:46:33 2013 +0200 @@ -40,6 +40,9 @@ public static final Pattern META_UNIT = Pattern.compile("^Einheit: \\[(.*)\\].*"); + public static final Pattern YEARS_IN_COLUMN = + Pattern.compile(".*(\\d{4})-(\\d{4})$"); + /** List of parsed differences as ImportWst s. */ private List<ImportWst> differences; @@ -67,7 +70,7 @@ @Override public void parse(File file) throws IOException { current = new ImportWst(file.getName()); - current.setKind(7); + current.setKind(6); super.parse(file); } @@ -152,6 +155,7 @@ } + /** Setup column structures with name, description and time interval. */ private void initColumns(String[] cols) { current.setNumberColumns(cols.length); columns = current.getColumns().toArray(new ImportWstColumn[cols.length]); @@ -162,6 +166,16 @@ log.debug("Create new column '" + name + "'"); current.getColumn(i).setName(name); current.getColumn(i).setDescription(name); + + Matcher m = YEARS_IN_COLUMN.matcher(name); + + if (m.matches()) { + String startYear = m.group(1); + String endYear = m.group(2); + // TODO create and set ImportTimeInterval + } else { + log.debug("No time interval in column header found: " + name); + } } }
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelParser.java Wed Jun 12 14:25:58 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelParser.java Fri Jun 14 16:46:33 2013 +0200 @@ -91,7 +91,7 @@ column = current.getColumn(0); column.setName(currentDescription); column.setDescription(currentDescription); - current.setKind(6); + current.setKind(7); }
--- a/backend/src/main/java/org/dive4elements/river/model/CrossSectionLine.java Wed Jun 12 14:25:58 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/model/CrossSectionLine.java Fri Jun 14 16:46:33 2013 +0200 @@ -43,7 +43,7 @@ public static final double TOO_BIG = 2500; private Integer id; - private Double km; + private Double km; private CrossSection crossSection; private List<CrossSectionPoint> points; @@ -151,6 +151,7 @@ return fetchCrossSectionProfile(fetchCrossSectionLinesPoints()); } + /** double[][] from List<Point2D> */ public static double [][] fetchCrossSectionProfile(List<Point2D> points) { int P = points.size();
--- a/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html Wed Jun 12 14:25:58 2013 +0200 +++ b/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html Fri Jun 14 16:46:33 2013 +0200 @@ -79,7 +79,7 @@ <area id="saale_area" shape="poly" onmouseover="highlight('Saale'); highlightList('Saale')" onmouseout="unHighlight('Saale'); unHighlightList('Saale')" onclick="selectRiver('Saale')" coords="445,314,414,311,366,299,366,342,395,346,404,356,424,358,477,354,463,341" /> <area id="saale_thüringen_area" shape="poly" onmouseover="highlight('Saale-Thüringen'); highlightList('Saale-Thüringen')" onmouseout="unHighlight('Saale-Thüringen'); unHighlightList('Saale-Thüringen')" onclick="selectRiver('Saale-Thüringen')" coords="424,358,476,354,490,384,430,461,375,444,387,415,402,408,420,387,435,383" /> <area id="saar_area" shape="poly" onmouseover="highlight('Saar'); highlightList('Saar')" onmouseout="unHighlight('Saar'); unHighlightList('Saar')" onclick="selectRiver('Saar')" coords="150,539,129,544,139,564,155,588,181,593,187,565,201,536,195,526,195,512,154,516" /> - <area id="saar_wittingerbogen_area" shape="poly" onmouseover="highlight('Saar (Wiltinger Bogen)'); highlightList('Saar (Wiltinger Bogen)')" onmouseout="unHighlight('Saar (Wiltinger Bogen)'); unHighlightList('Saar (Wiltinger Bogen)')" onclick="selectRiver('Saar (Wiltinger Bogen)')" coords="139,518,155,516,149,540,130,542" /> + <area id="saar_wiltingerbogen_area" shape="poly" onmouseover="highlight('Saar (Wiltinger Bogen)'); highlightList('Saar (Wiltinger Bogen)')" onmouseout="unHighlight('Saar (Wiltinger Bogen)'); unHighlightList('Saar (Wiltinger Bogen)')" onclick="selectRiver('Saar (Wiltinger Bogen)')" coords="139,518,155,516,149,540,130,542" /> <area id="werra_sommer_area" shape="poly" onmouseover="highlight('Werra (Sommer)'); highlightList('Werra (Sommer)')" onmouseout="unHighlight('Werra (Sommer)'); unHighlightList('Werra (Sommer)')" onclick="selectRiver('Werra (Sommer)')" coords="316,361,334,351,360,342,387,345,398,354,384,372,381,389,371,400,350,390,345,382,336,378,334,372,329,368" /> <area id="werra_winter_area" shape="poly" onmouseover="highlight('Werra (Winter)'); highlightList('Werra (Winter)')" onmouseout="unHighlight('Werra (Winter)'); unHighlightList('Werra (Winter)')" onclick="selectRiver('Werra (Winter)')" coords="315,362,326,388,334,398,350,409,370,400,353,391,347,388,346,385,344,382,335,378,333,372,329,368" /> <area id="weser_area" shape="poly" onmouseover="highlight('Weser'); highlightList('Weser')" onmouseout="unHighlight('Weser'); unHighlightList('Weser')" onclick="selectRiver('Weser')" coords="255,166,227,172,232,227,268,237,241,279,246,298,247,313,275,313,282,330,289,353,314,363,332,351,318,328,316,308,299,280,303,255,300,217,263,203,273,176" /> @@ -120,7 +120,9 @@ <img src="images/FLYS_Oder.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Oder" > <img src="images/FLYS_Rhein.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Rhein" > <img src="images/FLYS_Saale.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Saale" > + <img src="images/FLYS_Saale_Thüringen.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Saale-Thüringen" > <img src="images/FLYS_Saar.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Saar" > + <img src="images/FLYS_Saar_WiltingerBogen.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Saar (Wiltinger Bogen)" > <img src="images/FLYS_Werra_Sommer.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Werra (Sommer)" > <img src="images/FLYS_Werra_Winter.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Werra (Winter)" > <img src="images/FLYS_Weser.png" style="position: absolute; left: 8px; top: 8px; visibility: hidden; z-index: 50;" id="Weser" >