changeset 1186:be8b5c06a1f8

Use DGM Id in FLYSArtifact's data pool to query DGMs for floodmaps instead of querying DGMs by given range values. flys-artifacts/trunk@2782 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 16 Sep 2011 14:57:14 +0000
parents c5f494a9749d
children 47ecf98f09eb
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/meta-data.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java
diffstat 3 files changed, 22 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Sep 16 13:26:08 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Sep 16 14:57:14 2011 +0000
@@ -1,3 +1,11 @@
+2011-09-16  Ingo Weinzierl <ingo@intevation.de>
+
+	* doc/conf/meta-data.xml: Improved datacage configuration for DEMs.
+
+	* src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java:
+	  Query DGMs by the given ID in the FLYS data pool - not by given range
+	  values.
+
 2011-09-16  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/conf/meta-data.xml: Added a section for DEMs to the floodmap
--- a/flys-artifacts/doc/conf/meta-data.xml	Fri Sep 16 13:26:08 2011 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Fri Sep 16 14:57:14 2011 +0000
@@ -268,10 +268,11 @@
                       FROM dem WHERE river_id = ${river_id}
                     </dc:statement>
                     <dc:elements>
-                      <dem>
-                        <dc:attribute name="name" value="${dem_lower} - ${dem_upper}"/>
-                        <dc:attribute name="db-id" value="${dem_id}"/>
-                      </dem>
+                        <dem>
+                          <dc:attribute name="factory" value="demfactory"/>
+                          <dc:attribute name="ids" value="${dem_id}"/>
+                          <dc:attribute name="description" value="${dem_lower}-${dem_upper}"/>
+                        </dem>
                     </dc:elements>
                   </dc:context>
                 </dems>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Fri Sep 16 13:26:08 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Fri Sep 16 14:57:14 2011 +0000
@@ -639,15 +639,18 @@
 
 
     protected void setDgm(FLYSArtifact artifact, WSPLGENJob job) {
-        String   river = artifact.getDataAsString("river");
-        double[] range = FLYSUtils.getKmRange(artifact);
+        String dgm_id = artifact.getDataAsString("dgm");
 
-        DGM dgm = DGM.getDGM(river, range[0], range[1]);
+        int id = -1;
+        try {
+            id = Integer.parseInt(dgm_id);
+        }
+        catch (NumberFormatException nfe) { /* do nothing */ }
+
+        DGM dgm = DGM.getDGM(id);
 
         if (dgm == null) {
-            logger.warn(
-                "Could not find a DGM for river '" + river + "'" +
-                "(" + range[0] + " - " + range[1] + ")");
+            logger.warn("Could not find specified DGM.");
 
             return;
         }

http://dive4elements.wald.intevation.org