Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/InundationDurationCalculation.java @ 9481:787fc085459b
TSV introduced; uinfo.inundationWMS-Config
author | gernotbelger |
---|---|
date | Wed, 12 Sep 2018 10:55:09 +0200 |
parents | bc9a45d2b1fa |
children | bf6b63208f34 |
rev | line source |
---|---|
8996 | 1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
2 * Software engineering by |
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
3 * Björnsen Beratende Ingenieure GmbH |
8996 | 4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.artifacts.uinfo.inundationduration; | |
11 | |
9070
611a523fc42f
VegetationZoneAccessHelper, VegetationTablePanels verbessert
gernotbelger
parents:
9069
diff
changeset
|
12 import java.util.List; |
8996 | 13 |
14 import org.dive4elements.artifacts.CallContext; | |
15 import org.dive4elements.river.artifacts.model.Calculation; | |
16 import org.dive4elements.river.artifacts.model.CalculationResult; | |
17 import org.dive4elements.river.artifacts.uinfo.UINFOArtifact; | |
9481 | 18 import org.dive4elements.river.artifacts.uinfo.inundationduration.InundationDurationCalculationResult.WmsLayer; |
9404
bc9a45d2b1fa
common time range for gauges incl. error messages
gernotbelger
parents:
9190
diff
changeset
|
19 import org.dive4elements.river.artifacts.uinfo.vegetationzones.VegetationZoneServerClientXChange; |
8996 | 20 |
21 /** | |
22 * @author Domenico Nardi Tironi | |
23 * | |
24 */ | |
25 final class InundationDurationCalculation { | |
26 | |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
27 private final CallContext context; |
8996 | 28 |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
29 public InundationDurationCalculation(final CallContext context) { |
8996 | 30 this.context = context; |
31 } | |
32 | |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
33 public CalculationResult calculate(final UINFOArtifact uinfo) { |
8996 | 34 final Calculation problems = new Calculation(); |
35 | |
9481 | 36 final InundationDurationAccess indurax = new InundationDurationAccess(uinfo); |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
37 |
9070
611a523fc42f
VegetationZoneAccessHelper, VegetationTablePanels verbessert
gernotbelger
parents:
9069
diff
changeset
|
38 final String zonesRaw = indurax.getVegZones(); |
9404
bc9a45d2b1fa
common time range for gauges incl. error messages
gernotbelger
parents:
9190
diff
changeset
|
39 final List<VegetationZoneServerClientXChange> zones = VegetationZoneServerClientXChange.parse(zonesRaw); |
9481 | 40 |
41 final boolean isUseScenario = indurax.getIsUseScenario(); | |
42 | |
43 final InundationDurationCalculationResult result = new InundationDurationCalculationResult(); | |
44 | |
45 final WmsLayer inundationDurationLayer = indurax.createWMSLayer(this.context.getMeta(), "uinfo.export.url.inundationduration.inundationduration"); | |
46 result.addLayer(inundationDurationLayer); | |
8996 | 47 |
9190 | 48 // TODO: add vegetationzone-values as parameter to url and use this url as veg'zone'url |
9481 | 49 final WmsLayer vegetationLayer = indurax.createWMSLayer(this.context.getMeta(), "uinfo.export.url.inundationduration.vegetation"); |
50 result.addLayer(vegetationLayer); | |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
51 |
9190 | 52 if (isUseScenario) { |
9481 | 53 // TODO: wieder einkommentieren, sobald die URL-Definition für Szenarien geklärt ist (und hoffentlich analog zu "mittel" |
54 // und "jahre" funktioniert) | |
55 // final WmsLayer scenarioInundationDurationLayer = indurax.createScenarioWMSLayer(this.context.getMeta(), | |
56 // "uinfo.export.url.inundationduration.scenario"); | |
57 // result.addLayer(scenarioInundationDurationLayer); | |
58 // | |
59 // // TODO: add vegetationzone-values as styles to layer | |
60 // final WmsLayer scenarioVegetationLayer = indurax.createScenarioWMSLayer(this.context.getMeta(), | |
61 // "uinfo.export.url.inundationduration.vegetation_scenario"); | |
62 // result.addLayer(scenarioVegetationLayer); | |
9190 | 63 } |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
8996
diff
changeset
|
64 |
9190 | 65 return new CalculationResult(result, problems); |
8996 | 66 } |
67 } |