[PATCH] issue766: Minimal fix for doubled RiverAxis

Wald Commits scm-commit at wald.intevation.org
Mon Jul 29 19:21:10 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1375118467 -7200
# Node ID f3d0aac478cded3ef7d406262ba28117336b8528
# Parent  ed9cff3194795fedaf64d370cef1a9abdd036933
issue766: Minimal fix for doubled RiverAxis.

    Ceterum autem censeo river_wms esse delendam

diff -r ed9cff319479 -r f3d0aac478cd artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java	Mon Jul 29 17:27:48 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java	Mon Jul 29 19:21:07 2013 +0200
@@ -91,6 +91,10 @@
             super(artifact);
         }
 
+        private boolean isUnofficial() {
+            return getIdPart(2) != null && !getIdPart(2).equals("1");
+        }
+
         @Override
         protected String getFacetType() {
             return FLOODMAP_RIVERAXIS;
@@ -98,12 +102,24 @@
 
         @Override
         protected String getLayer() {
+            if (isUnofficial()) {
+                return super.getLayer();
+            }
             return RiverFactory.getRiver(getRiverId()).getName();
         }
 
         @Override
         protected String getUrl() {
-            return RiverUtils.getRiverWMSUrl();
+            String kind = getIdPart(2);
+            logger.debug("Andre get url of river axis " + kind);
+
+            if (isUnofficial()) {
+                logger.debug("Returning as url: " + RiverUtils.getUserWMSUrl(artifact.identifier()));
+
+                return RiverUtils.getUserWMSUrl(artifact.identifier());
+            } else {
+                return RiverUtils.getRiverWMSUrl();
+            }
         }
 
         @Override


More information about the Dive4elements-commits mailing list