comparison flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java @ 2235:ee5310134463

Cosmetics/care/refac. flys-artifacts/trunk@3879 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 02 Feb 2012 13:23:55 +0000
parents 31fa7cae0f35
children 997df76c6f58
comparison
equal deleted inserted replaced
2234:46ec09c7f578 2235:ee5310134463
228 } 228 }
229 } 229 }
230 } 230 }
231 231
232 return new double[] { Double.NaN, Double.NaN }; 232 return new double[] { Double.NaN, Double.NaN };
233 }
234
235
236 /**
237 * Get bounds for river of artifact.
238 * @param flysArtifact artifact which has a "river" data.
239 * @return double array. min is at[0], max at[1]. null if given artifact is null
240 */
241 public static double[] getRiverMinMax(FLYSArtifact flysArtifact) {
242 if (flysArtifact == null) {
243 return null;
244 }
245
246 String riverName = flysArtifact.getDataAsString("river");
247
248 if (riverName == null) {
249 riverName = "";
250 }
251
252 logger.debug("Search for the min/max distances of '" + riverName + "'");
253
254 River river = RiverFactory.getRiver(riverName);
255
256 return river != null
257 ? river.determineMinMaxDistance()
258 : null;
233 } 259 }
234 260
235 261
236 public static double[] getKmFromTo(FLYSArtifact flys) { 262 public static double[] getKmFromTo(FLYSArtifact flys) {
237 String strFrom = flys.getDataAsString("ld_from"); 263 String strFrom = flys.getDataAsString("ld_from");

http://dive4elements.wald.intevation.org