[Dive4elements-commits] [PATCH] Little work on the RiverMapfileGenerator

Wald Commits scm-commit at wald.intevation.org
Wed Jan 2 15:15:52 CET 2013


# HG changeset patch
# User Christian Lins <christian.lins at intevation.de>
# Date 1357136145 -3600
# Node ID d93748043cbc4ae0d27b1c3e6369734d0264aee1
# Parent  718adea968e2fdc08ab30858b01f4cafb5c322b3
Little work on the RiverMapfileGenerator.

diff -r 718adea968e2 -r d93748043cbc flys-artifacts/doc/conf/mapserver/riveraxis-layer.vm
--- a/flys-artifacts/doc/conf/mapserver/riveraxis-layer.vm	Wed Jan 02 14:05:21 2013 +0100
+++ b/flys-artifacts/doc/conf/mapserver/riveraxis-layer.vm	Wed Jan 02 15:15:45 2013 +0100
@@ -2,8 +2,7 @@
     NAME "$LAYER.getName()"
     TYPE $LAYER.getType()
 
-    CONNECTIONTYPE $LAYER.getConnectionType()
-    CONNECTION "$LAYER.getConnection()"
+    INCLUDE "conf/dbconnection.include"
 
     DATA    "$LAYER.getData()"
     FILTER  "$LAYER.getFilter()"
diff -r 718adea968e2 -r d93748043cbc flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java	Wed Jan 02 14:05:21 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java	Wed Jan 02 15:15:45 2013 +0100
@@ -52,7 +52,7 @@
                     river.getName(),
                     river.getId(),
                     "41677",
-                    "100,100,100,100");
+                    "-10000 -10000 10000 10000");
             riverFiles.add("river-" + river.getName() + ".map");
         }
         writeMapfile(riverFiles);
@@ -63,12 +63,15 @@
         layerInfo.setName(riverName);
         layerInfo.setSrid(srid);
         layerInfo.setExtent(extend);
-        layerInfo.setConnectionType(FLYSUtils.isUsingOracle() ? "oraclespatial" : "postgis");
+        layerInfo.setType("line");
+        layerInfo.setData("geom FROM river_axis");      // FIXME: Use templates for that
+        layerInfo.setFilter("river_id = " + riverID);
+        layerInfo.setTitle(riverName + " RiverAxis");
 
         File layerFile = new File("river-" + riverName + ".map");
-        Template template = getTemplateByName(DB_LAYER_TEMPLATE);
+        Template template = getTemplateByName("riveraxis-layer.vm");
         if (template == null) {
-            logger.warn("Template '" + DB_LAYER_TEMPLATE + "' not found.");
+            logger.warn("Template riveraxis-layer.vm not found.");
             return;
         }
 


More information about the Dive4elements-commits mailing list