# HG changeset patch # User Ingo Weinzierl # Date 1320161634 0 # Node ID 50110699e38ed9c101bb938c271798789ce99669 # Parent 5e9696c32f04902fc250a30a630ffa850228062f Determine correct bounding box a KMs WMS layer. flys-artifacts/trunk@3134 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 5e9696c32f04 -r 50110699e38e flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Nov 01 14:54:59 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Nov 01 15:33:54 2011 +0000 @@ -1,3 +1,9 @@ +2011-11-01 Ingo Weinzierl + + * src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java: Determine + the extent of such WMS layer based on the list of RiverAxisKm objects + returned by the backend. + 2011-11-01 Ingo Weinzierl * doc/conf/meta-data.xml: Added a datacage node that represents a diff -r 5e9696c32f04 -r 50110699e38e flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java Tue Nov 01 14:54:59 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java Tue Nov 01 15:33:54 2011 +0000 @@ -17,7 +17,7 @@ import de.intevation.artifactdatabase.state.State; import de.intevation.flys.model.River; -import de.intevation.flys.model.RiverAxis; +import de.intevation.flys.model.RiverAxisKm; import de.intevation.flys.artifacts.WMSDBArtifact.WMSDBState; import de.intevation.flys.artifacts.model.FacetTypes; @@ -101,18 +101,6 @@ return riverId; } - public Geometry getGeom() { - if (geom == null) { - // TODO replace riveraxis with kilometrage geometry - River river = RiverFactory.getRiver(getRiverId()); - RiverAxis a = RiverAxis.getRiverAxis(river.getName()); - - geom = a.getGeom(); - } - - return geom; - } - @Override protected String getFacetType() { return FLOODMAP_KMS; @@ -136,7 +124,22 @@ @Override protected Envelope getExtent() { - return getGeom().getEnvelopeInternal(); + List kms = RiverAxisKm.getRiverAxisKms(getRiverId()); + + Envelope max = null; + + for (RiverAxisKm km: kms) { + Envelope env = km.getGeom().getEnvelopeInternal(); + + if (max == null) { + max = env; + continue; + } + + max.expandToInclude(env); + } + + return max; } @Override