Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java Thu Feb 02 12:50:33 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java Thu Feb 02 13:23:55 2012 +0000 @@ -233,6 +233,32 @@ } + /** + * Get bounds for river of artifact. + * @param flysArtifact artifact which has a "river" data. + * @return double array. min is at[0], max at[1]. null if given artifact is null + */ + public static double[] getRiverMinMax(FLYSArtifact flysArtifact) { + if (flysArtifact == null) { + return null; + } + + String riverName = flysArtifact.getDataAsString("river"); + + if (riverName == null) { + riverName = ""; + } + + logger.debug("Search for the min/max distances of '" + riverName + "'"); + + River river = RiverFactory.getRiver(riverName); + + return river != null + ? river.determineMinMaxDistance() + : null; + } + + public static double[] getKmFromTo(FLYSArtifact flys) { String strFrom = flys.getDataAsString("ld_from"); String strTo = flys.getDataAsString("ld_to");