Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java @ 1774:092e1e5020bc
Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
flys-artifacts/trunk@3095 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 28 Oct 2011 05:54:25 +0000 |
parents | aaf8d32f85bd |
children | 0156105222c9 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java Thu Oct 27 14:04:04 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/FacetCreator.java Fri Oct 28 05:54:25 2011 +0000 @@ -3,6 +3,8 @@ import java.util.ArrayList; import java.util.List; +import com.vividsolutions.jts.geom.Envelope; + import de.intevation.artifacts.CallContext; import de.intevation.artifactdatabase.state.Facet; @@ -66,7 +68,7 @@ return FLYSUtils.getRiverSrid(artifact); } - protected String getWSPLGENBounds() { + protected Envelope getWSPLGENBounds() { String river = getRiver(); double kms[] = FLYSUtils.getKmRange(artifact); @@ -80,11 +82,16 @@ return null; } - return GeometryUtils.createOLBounds(a.getGeom(), b.getGeom()); + Envelope envA = a.getGeom().getEnvelopeInternal(); + Envelope envB = b.getGeom().getEnvelopeInternal(); + + envA.expandToInclude(envB); + + return envA; } - protected String getBounds() { - return GeometryUtils.getRiverBounds(getRiver()); + protected Envelope getBounds() { + return GeometryUtils.getRiverBoundary(getRiver()); } public List<Facet> getFacets() { @@ -104,9 +111,9 @@ hash, getUrl()); - String bounds = getWSPLGENBounds(); + Envelope bounds = getWSPLGENBounds(); - if (bounds == null || bounds.length() == 0) { + if (bounds == null) { bounds = getBounds(); }