[Dive4elements-commits] [PATCH] Preparations for autogenerated riveraxis WMSs

Wald Commits scm-commit at wald.intevation.org
Tue Dec 4 14:20:05 CET 2012


# HG changeset patch
# User Christian Lins <christian.lins at intevation.de>
# Date 1354627199 -3600
# Node ID fc52ee8784120da5d13c7caf3376abace303ae09
# Parent  02cf2b1dff84a02a734f168695ee5ad962a313b0
Preparations for autogenerated riveraxis WMSs.

diff -r 02cf2b1dff84 -r fc52ee878412 flys-artifacts/doc/mapserver/river-mapfile.vm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/doc/mapserver/river-mapfile.vm	Tue Dec 04 14:19:59 2012 +0100
@@ -0,0 +1,60 @@
+MAP
+    NAME "River $RIVERNAME"
+    STATUS ON
+    SIZE 600 400
+    MAXSIZE 4000
+    EXTENT 3233232.55407617 5303455.37850183 3421524.44644752 5585825.50888523
+    UNITS DD
+    SHAPEPATH "$SHAPEFILEPATH"
+    FONTSET "$CONFIGDIR/mapserver/fontset.txt"
+    SYMBOLSET "$CONFIGDIR/mapserver/symbols.sym"
+    IMAGECOLOR 255 255 255
+    PROJECTION
+        "init=epsg:31467"
+    END
+
+    DEBUG 5
+    CONFIG "MS_ERRORFILE" "log/river-$RIVERNAME.log"
+
+    WEB
+      METADATA
+        "wms_title"             "FLYS $RIVERNAME Web Map Service"
+        "wms_onlineresource"    "$MAPSERVERURL"
+        "wms_accessconstraints" "none"
+        "wms_fees"              "none"
+        "wms_addresstype"       "postal"
+        "wms_address"           "Any Street"
+        "wms_city"              "Any City"
+        "wms_stateorprovince"   "Any state"
+        "wms_postcode"          "My Postalcode"
+        "wms_country"           "Any Country"
+        "wms_contactperson"     "Any Person"
+        "wms_contactorganization" "Any Orga"
+        "wms_contactelectronicmailaddress" "any-email at example.com"
+        "wms_contactvoicetelephone" "Any's telephone number"
+        "wms_srs" "EPSG:4326 EPSG:31466 EPSG:31467"
+        "wms_feature_info_mime_type" "text/html"
+        "ows_enable_request"   "*"
+      END
+    END
+
+    LEGEND
+        KEYSIZE 20 20
+        STATUS ON
+        TRANSPARENT ON
+
+        LABEL
+            COLOR 150 150 150
+            OUTLINECOLOR 255 255 255
+            TYPE truetype
+            FONT "FreeSans"
+            SIZE 12
+            POSITION AUTO
+        END
+    END
+
+    ## Don't change the following lines.
+    #foreach ($LAYER in $LAYERS)
+        include "$LAYER"
+    #end
+END
\ No newline at end of file
diff -r 02cf2b1dff84 -r fc52ee878412 flys-artifacts/doc/mapserver/riveraxis-layer.vm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/doc/mapserver/riveraxis-layer.vm	Tue Dec 04 14:19:59 2012 +0100
@@ -0,0 +1,58 @@
+LAYER
+    NAME "$LAYER.getName()"
+    TYPE $LAYER.getType()
+
+    CONNECTIONTYPE $LAYER.getConnectionType()
+    CONNECTION "$LAYER.getConnection()"
+
+    DATA    "$LAYER.getData()"
+    FILTER  "$LAYER.getFilter()"
+    EXTENT  $LAYER.getExtent()
+
+    STATUS    ON
+    TEMPLATE  map.html
+    TOLERANCE 10
+    DUMP      TRUE
+    #if( $LAYER.getGroup() )
+        GROUP "$LAYER.getGroup()"
+    #end
+
+    #if ( $LAYER.getLabelItem() )
+        LABELITEM $LAYER.getLabelItem()
+    #end
+
+    PROJECTION
+        "init=epsg:31467"
+    END
+
+    METADATA
+        "wms_title" "$LAYER.getTitle()"
+        "gml_include_items" "all"
+        #if ( $LAYER.getGroupTitle() )
+            "wms_group_title" "$LAYER.getGroupTitle()"
+        #end
+    END
+
+    #if ( $LAYER.getStyle() )
+        $LAYER.getStyle()
+    #else
+        CLASS
+            NAME ""
+            STYLE
+                SIZE 5
+                OUTLINECOLOR "#000000"
+            END
+            #if ( $LAYER.getLabelItem() )
+                LABEL
+                    ANGLE auto
+                    SIZE 10
+                    COLOR "#000000"
+                    TYPE truetype
+                    FONT LiberationSans-Italic
+                    POSITION ur
+                    OFFSET 2 2
+                END
+            #end
+        END
+    #end
+END
\ No newline at end of file
diff -r 02cf2b1dff84 -r fc52ee878412 flys-artifacts/src/main/java/de/intevation/flys/exports/MapGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/MapGenerator.java	Tue Dec 04 13:20:38 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/MapGenerator.java	Tue Dec 04 14:19:59 2012 +0100
@@ -137,7 +137,7 @@
                 mfg.createUeskLayer(
                     flys,
                     (WSPLGENLayerFacet) wms,
-                    ThemeUtil.createWSPLGENStyle(attr),
+                    ThemeUtil.createDynamicMapserverStyle(attr),
                     context);
             }
             else {
diff -r 02cf2b1dff84 -r fc52ee878412 flys-artifacts/src/main/java/de/intevation/flys/utils/MapfileGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/MapfileGenerator.java	Tue Dec 04 13:20:38 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/MapfileGenerator.java	Tue Dec 04 14:19:59 2012 +0100
@@ -235,9 +235,11 @@
         }
         catch (FileNotFoundException fnfe) {
             // this is bad
+            logger.warn(fnfe, fnfe);
         }
         catch (IOException ioe) {
             // this is also bad
+            logger.warn(ioe, ioe);
         }
 
         return context;
diff -r 02cf2b1dff84 -r fc52ee878412 flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Tue Dec 04 13:20:38 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Tue Dec 04 14:19:59 2012 +0100
@@ -623,7 +623,14 @@
     }
 
 
-    public static String createWSPLGENStyle(Document theme) {
+    /**
+     * Creates a MapserverStyle from the given XML theme.
+     * This method uses a start- and endcolor to interpolate a
+     * given number of color classes for the MapserverStyle.
+     * @param theme
+     * @return String representation of the MapserverStyle
+     */
+    public static String createDynamicMapserverStyle(Document theme) {
         MapserverStyle ms = new MapserverStyle();
 
         String strStartColor = XMLUtils.xpathString(theme, XPATH_WSPLGEN_STARTCOLOR, null);


More information about the Dive4elements-commits mailing list