[Dive4elements-commits] [PATCH 8 of 9] Handle kind filtering in QPS WMS artifact
Wald Commits
scm-commit at wald.intevation.org
Wed Mar 27 15:40:14 CET 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1364395057 -3600
# Node ID 948a106bc4cd3bf93d7dcfcee4589d3988ebfa6d
# Parent 84da5ed67e93fc18e598441c6742fef0733b39f2
Handle kind filtering in QPS WMS artifact
diff -r 84da5ed67e93 -r 948a106bc4cd flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java Wed Mar 27 15:36:44 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java Wed Mar 27 15:37:37 2013 +0100
@@ -100,9 +100,20 @@
@Override
protected Envelope getExtent(boolean reproject) {
River river = RiverFactory.getRiver(getRiverId());
+ List<CrossSectionTrack> qps;
- List<CrossSectionTrack> qps =
- CrossSectionTrack.getCrossSectionTrack(river.getName());
+ String kind = getIdPart(2);
+
+ if (kind != null && kind.equals("1")) {
+ qps = CrossSectionTrack.getCrossSectionTrack(river.getName(),
+ Integer.parseInt(kind));
+ } else if (kind != null) {
+ qps = CrossSectionTrack.getCrossSectionTrack(river.getName(),
+ getName(), Integer.parseInt(kind));
+ } else {
+ qps = CrossSectionTrack.getCrossSectionTrack(river.getName(),
+ getName());
+ }
Envelope max = null;
@@ -124,7 +135,18 @@
@Override
protected String getFilter() {
- return "river_id=" + String.valueOf(getRiverId());
+ String kind = getIdPart(2);
+ if (kind != null && kind.equals("1")) {
+ // There can be several layers named qps that differ in kind
+ return "river_id=" + String.valueOf(getRiverId()) +
+ " AND kind_id=" + kind;
+ } else if (kind != null) {
+ return "river_id=" + String.valueOf(getRiverId()) +
+ " AND kind_id=" + kind +
+ " AND name='" + getName() + "'";
+ }
+ return "river_id=" + String.valueOf(getRiverId()) +
+ " AND name='" + getName() + "'";
}
@Override
More information about the Dive4elements-commits
mailing list