Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.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 | 394841a66c14 |
children | d3f170484455 |
comparison
equal
deleted
inserted
replaced
5175:cfc5540a4eec | 5379:61bf64b102bc |
---|---|
173 @Override | 173 @Override |
174 protected void initialize(Artifact artifact, Object context, CallMeta meta) { | 174 protected void initialize(Artifact artifact, Object context, CallMeta meta) { |
175 logger.debug("MainValuesArtifact.initialize"); | 175 logger.debug("MainValuesArtifact.initialize"); |
176 FLYSArtifact winfo = (FLYSArtifact) artifact; | 176 FLYSArtifact winfo = (FLYSArtifact) artifact; |
177 RangeAccess rangeAccess = new RangeAccess(winfo, null); | 177 RangeAccess rangeAccess = new RangeAccess(winfo, null); |
178 double [] locations = rangeAccess.getLocations(); | 178 double [] locations = rangeAccess.getKmRange(); |
179 | |
179 if (locations != null) { | 180 if (locations != null) { |
180 double location = locations[0]; | 181 double location = locations[0]; |
181 addData("ld_locations", new DefaultStateData("ld_locations", null, null, | 182 addData("ld_locations", new DefaultStateData("ld_locations", null, null, |
182 String.valueOf(location))); | 183 String.valueOf(location))); |
183 } | 184 } |
184 else { | 185 else { |
185 logger.warn("No location for mainvalues given."); | 186 logger.error("No location for mainvalues given."); |
186 } | 187 } |
187 importData(winfo, "river"); | 188 importData(winfo, "river"); |
188 } | 189 } |
189 | 190 |
190 | 191 |
245 River river = FLYSUtils.getRiver(this); | 246 River river = FLYSUtils.getRiver(this); |
246 | 247 |
247 // TODO use helper to get location as double | 248 // TODO use helper to get location as double |
248 String locationStr = getDataAsString("ld_locations"); | 249 String locationStr = getDataAsString("ld_locations"); |
249 | 250 |
250 if (river == null || locationStr == null) { | 251 if (river == null) { |
252 logger.error("River is null"); | |
253 return null; | |
254 } | |
255 | |
256 if (locationStr == null) { | |
257 logger.error("Locationstr is null"); | |
251 return null; | 258 return null; |
252 } | 259 } |
253 | 260 |
254 double location = Double.parseDouble(locationStr); | 261 double location = Double.parseDouble(locationStr); |
255 | 262 |