changeset 1109:ba9fa72dd6f5

Write file path of DMGs into the WSPLGEN job while preparing WSPLGEN. flys-artifacts/trunk@2614 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 31 Aug 2011 07:50:01 +0000
parents 5b1198c27d43
children 563e015f0f22
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java
diffstat 2 files changed, 26 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Aug 30 15:17:43 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Aug 31 07:50:01 2011 +0000
@@ -1,3 +1,9 @@
+2011-08-31  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java:
+	  Search for a DGM that fits to the current river and km range and write
+	  its file path into the WSPLGEN job.
+
 2011-08-30  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/utils/GeometryUtils.java: Improved
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Tue Aug 30 15:17:43 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Wed Aug 31 07:50:01 2011 +0000
@@ -29,6 +29,7 @@
 import de.intevation.artifactdatabase.state.Facet;
 
 import de.intevation.flys.model.CrossSectionTrack;
+import de.intevation.flys.model.DGM;
 import de.intevation.flys.model.RiverAxis;
 
 import de.intevation.flys.artifacts.FLYSArtifact;
@@ -177,9 +178,9 @@
         setLine(artifact, artifactDir, job);
         setAxis(artifact, artifactDir, job);
         setPro(artifact, artifactDir, job);
+        setDgm(artifact, job);
 
         // TODO
-        // setDgm(artifact, job);    // SHP
         // setWsp(artifact, job);    // WSP
         // setWspTag(artifact, job);
         // setArea(artifact, job);   // SHP
@@ -418,5 +419,23 @@
             logger.error("Error while writing shapefile: " + ioe.getMessage());
         }
     }
+
+
+    protected void setDgm(FLYSArtifact artifact, WSPLGENJob job) {
+        String   river = artifact.getDataAsString("river");
+        double[] range = FLYSUtils.getKmRange(artifact);
+
+        DGM dgm = DGM.getDGM(river, range[0], range[1]);
+
+        if (dgm == null) {
+            logger.warn(
+                "Could not find a DGM for river '" + river + "'" +
+                "(" + range[0] + " - " + range[1] + ")");
+
+            return;
+        }
+
+        job.setDgm(dgm.getPath());
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org