diff flys-artifacts/doc/conf/meta-data.xml @ 5496:23d8f2700b38

Add support for multiple floodplains and add them to the datacage accordingly
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 28 Mar 2013 12:39:14 +0100
parents ae60bb7b8085
children 87dab419b924
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/meta-data.xml	Thu Mar 28 12:38:06 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Thu Mar 28 12:39:14 2013 +0100
@@ -1321,17 +1321,42 @@
             <dc:macro name="flood-map-floodplain">
               <dc:context>
                 <dc:statement>
-                  SELECT count(*) as km_exists
-                  FROM floodplain WHERE river_id = ${river_id}
+                  SELECT DISTINCT
+                  fp.kind_id as kind_id,
+                  flk.name as kind_name
+                  FROM floodplain fp
+                  JOIN floodplain_kinds flk on fp.kind_id = flk.id
+                  WHERE river_id = ${river_id}
+                  AND kind_id=1
                 </dc:statement>
-                 <dc:elements>
-                  <dc:if test="$km_exists>0">
-                    <floodplain>
-                      <dc:attribute name="factory" value="wmsfloodplainfactory"/>
-                      <dc:attribute name="ids" value="${river_id}"/>
-                    </floodplain>
-                  </dc:if>
-                </dc:elements>
+                <dc:if test="dc:has-result()">
+                  <dc:elements>
+                    <floody factory="wmsfloodplainfactory"
+                      description="{$kind_name}"
+                      ids="{$river_id};{$kind_name};{$kind_id}"/>
+                  </dc:elements>
+                </dc:if>
+              </dc:context>
+              <dc:context>
+                <dc:statement>
+                  SELECT DISTINCT
+                  flk.name as kind_name,
+                  fp.kind_id as kind_id,
+                  fp.name as layer_name
+                  FROM floodplain fp
+                  JOIN floodplain_kinds flk on fp.kind_id = flk.id
+                  WHERE river_id = ${river_id}
+                  AND kind_id &lt;&gt; 1
+                </dc:statement>
+                <dc:if test="dc:has-result()">
+                  <other>
+                    <dc:elements>
+                      <floody factory="wmsfloodplainfactory"
+                        description="{$layer_name}"
+                        ids="{$river_id};{$layer_name};{$kind_id}"/>
+                    </dc:elements>
+                  </other>
+                </dc:if>
               </dc:context>
             </dc:macro>
 
@@ -1809,8 +1834,8 @@
                   <dc:call-macro name="flood-map-routing"/>
                 </route_data>
                 <hydrboundaries>
+                  <dc:call-macro name="flood-map-floodplain"/>
                   <dc:call-macro name="flood-map-hydr-boundaries"/>
-                  <dc:call-macro name="flood-map-floodplain"/>
                 </hydrboundaries>
                 <dc:call-macro name="flood-map-uesk"/>
                 <gaugelocations>

http://dive4elements.wald.intevation.org