# HG changeset patch # User Ingo Weinzierl # Date 1323077700 0 # Node ID ccf2235035d609ac5d496c8be501bf8b41e30943 # Parent 2adfedaf4dd2849339dd1118dd8b79a171df7fb0 Various bugfixes in WSPLGEN parameterization. flys-artifacts/trunk@3351 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 2adfedaf4dd2 -r ccf2235035d6 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Dec 05 09:33:20 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Dec 05 09:35:00 2011 +0000 @@ -1,3 +1,10 @@ +2011-12-05 Ingo Weinzierl + + * src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java: + Bugfix: Evaluate the correct parameter whether to set the floodplain or + not. In addition, the scenario parameter used by WSPLGEN is now set + correctly. + 2011-12-05 Felix Wolfsteller Allow longitudinal_section.q facets in wdiff states output. diff -r 2adfedaf4dd2 -r ccf2235035d6 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 Mon Dec 05 09:33:20 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java Mon Dec 05 09:35:00 2011 +0000 @@ -287,17 +287,21 @@ protected void setGel(FLYSArtifact artifact, WSPLGENJob job) { - String gel = artifact.getDataAsString("use_floodplain"); - - if (gel != null && gel.length() > 0) { - boolean use = Boolean.parseBoolean(gel); + String gel = artifact.getDataAsString("scenario"); - if (use) { - job.setGel(WSPLGENJob.GEL_SPERRE); - } - else { - job.setGel(WSPLGENJob.GEL_NOSPERRE); - } + logger.debug("Selected gel = '" + gel + "'"); + + if (gel == null || gel.length() == 0) { + job.setGel(WSPLGENJob.GEL_NOSPERRE); + } + else if (gel.equals("scenario.current")) { + job.setGel(WSPLGENJob.GEL_SPERRE); + } + else if (gel.equals("scenario.scenario")) { + job.setGel(WSPLGENJob.GEL_SPERRE); + } + else { + job.setGel(WSPLGENJob.GEL_NOSPERRE); } } @@ -347,6 +351,8 @@ new Object[] { "typ", String.class } }; + String scenario = job.getGel(); + boolean l = GeometryUtils.writeShapefile( shapeLines, GeometryUtils.buildFeatureType("lines", srs, LineString.class, obj), @@ -356,7 +362,13 @@ logger.debug( "Successfully created barrier line shapefile. " + "Write shapefile path into WSPLGEN job."); - job.addLin(shapeLines.getAbsolutePath()); + + if (scenario.equals(WSPLGENJob.GEL_NOSPERRE)) { + logger.debug("WSPLGEN will not use barrier features."); + } + else { + job.addLin(shapeLines.getAbsolutePath()); + } } boolean p = GeometryUtils.writeShapefile( @@ -368,7 +380,13 @@ logger.debug( "Successfully created barrier polygon shapefile. " + "Write shapefile path into WSPLGEN job."); - job.addLin(shapePolys.getAbsolutePath()); + + if (scenario.equals(WSPLGENJob.GEL_NOSPERRE)) { + logger.debug("WSPLGEN will not use barrier features."); + } + else { + job.addLin(shapePolys.getAbsolutePath()); + } } if (p || l) { @@ -581,6 +599,12 @@ protected void setArea(FLYSArtifact artifact, File dir, WSPLGENJob job) { + String useFloodplain = artifact.getDataAsString("use_floodplain"); + if (!Boolean.valueOf(useFloodplain)) { + logger.debug("WSPLGEN will not use floodplain."); + return; + } + String river = artifact.getDataAsString("river"); String srid = FLYSUtils.getRiverSrid(artifact); String srs = "EPSG:" + srid;