Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityCalculation.java @ 5379:61bf64b102bc mapgenfix
Merge with default branch
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 22 Mar 2013 11:25:54 +0100 |
parents | c7ce7c9e405e |
children |
comparison
equal
deleted
inserted
replaced
5175:cfc5540a4eec | 5379:61bf64b102bc |
---|---|
1 package de.intevation.flys.artifacts.model; | 1 package de.intevation.flys.artifacts.model; |
2 | |
3 import java.util.ArrayList; | |
4 import java.util.Collections; | |
5 import java.util.List; | |
6 | 2 |
7 import de.intevation.artifacts.Artifact; | 3 import de.intevation.artifacts.Artifact; |
8 | 4 |
9 import de.intevation.flys.artifacts.access.FlowVelocityAccess; | 5 import de.intevation.flys.artifacts.access.FlowVelocityAccess; |
10 | 6 |
11 import de.intevation.flys.model.DischargeZone; | 7 import de.intevation.flys.model.DischargeZone; |
12 import de.intevation.flys.model.FlowVelocityModel; | 8 import de.intevation.flys.model.FlowVelocityModel; |
13 import de.intevation.flys.model.FlowVelocityModelValue; | 9 import de.intevation.flys.model.FlowVelocityModelValue; |
14 import de.intevation.flys.model.River; | 10 |
11 import java.util.ArrayList; | |
12 import java.util.Collections; | |
13 import java.util.List; | |
15 | 14 |
16 import org.apache.log4j.Logger; | 15 import org.apache.log4j.Logger; |
17 | 16 |
18 | 17 |
19 /** Calculate flow velocity. */ | 18 /** Calculate flow velocity. */ |
95 if (riverName == null) { | 94 if (riverName == null) { |
96 logger.warn("No river name found"); | 95 logger.warn("No river name found"); |
97 return Collections.<FlowVelocityModel>emptyList(); | 96 return Collections.<FlowVelocityModel>emptyList(); |
98 } | 97 } |
99 | 98 |
100 River river = RiverFactory.getRiver(riverName); | |
101 if (river == null) { | |
102 logger.warn("No such river: " + riverName); | |
103 return Collections.<FlowVelocityModel>emptyList(); | |
104 } | |
105 | |
106 List<FlowVelocityModel> models = new ArrayList<FlowVelocityModel>(); | 99 List<FlowVelocityModel> models = new ArrayList<FlowVelocityModel>(); |
107 | 100 |
108 for (DischargeZone zone: zones) { | 101 for (DischargeZone zone: zones) { |
109 List<FlowVelocityModel> model = | 102 List<FlowVelocityModel> model = FlowVelocityModel.getModels(zone); |
110 FlowVelocityModel.getModels(river, zone); | 103 models.addAll(model); |
111 | |
112 if (model != null) { | |
113 models.addAll(model); | |
114 } | |
115 } | 104 } |
116 | 105 |
117 return models; | 106 return models; |
118 } | 107 } |
119 | 108 |