Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java @ 2078:cbeeaaad1056
#440 Support river axes that consist of more than a single geometry.
flys-artifacts/trunk@3593 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 05 Jan 2012 10:46:32 +0000 |
parents | 092e1e5020bc |
children | 33aa37e6d98f |
comparison
equal
deleted
inserted
replaced
2077:29459ddb6f30 | 2078:cbeeaaad1056 |
---|---|
44 private GeometryUtils() { | 44 private GeometryUtils() { |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 public static Envelope getRiverBoundary(String rivername) { | 48 public static Envelope getRiverBoundary(String rivername) { |
49 RiverAxis axis = RiverAxis.getRiverAxis(rivername); | 49 List<RiverAxis> axes = RiverAxis.getRiverAxis(rivername); |
50 if (axis != null) { | 50 if (axes != null && axes.size() > 0) { |
51 // TODO Take the correct EPSG into account. Maybe, we need to | 51 Envelope max = null; |
52 // reproject the geometry. | 52 |
53 return axis.getGeom().getEnvelopeInternal(); | 53 for (RiverAxis axis: axes) { |
54 // TODO Take the correct EPSG into account. Maybe, we need to | |
55 // reproject the geometry. | |
56 Envelope env = axis.getGeom().getEnvelopeInternal(); | |
57 | |
58 if (max == null) { | |
59 max = env; | |
60 } | |
61 else { | |
62 max.expandToInclude(env); | |
63 } | |
64 } | |
65 | |
66 return max; | |
54 } | 67 } |
55 | 68 |
56 return null; | 69 return null; |
57 } | 70 } |
58 | 71 |