# HG changeset patch # User Ingo Weinzierl # Date 1316185034 0 # Node ID be8b5c06a1f85befee20f9e7894aa76b24d15a5a # Parent c5f494a9749dbd8cbb1f5820de8ed61d57d14c59 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 diff -r c5f494a9749d -r be8b5c06a1f8 flys-artifacts/ChangeLog --- 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 + + * 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 * doc/conf/meta-data.xml: Added a section for DEMs to the floodmap diff -r c5f494a9749d -r be8b5c06a1f8 flys-artifacts/doc/conf/meta-data.xml --- 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} - - - - + + + + + diff -r c5f494a9749d -r be8b5c06a1f8 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java --- 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; }