[Dive4elements-commits] [PATCH 5 of 9] Restructure datacage to have a route_data folder

Wald Commits scm-commit at wald.intevation.org
Wed Mar 27 15:40:11 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1364394445 -3600
# Node ID ba1bf40a9787d1a79119c2e75df016e7302aba6f
# Parent  c8e74e5e828c50bff99f389508fd4fe6db63c76b
Restructure datacage to have a route_data folder
and add QPS in a more detailed manner in that folder

diff -r c8e74e5e828c -r ba1bf40a9787 flys-artifacts/doc/conf/meta-data.xml
--- a/flys-artifacts/doc/conf/meta-data.xml	Wed Mar 27 15:26:28 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Wed Mar 27 15:27:25 2013 +0100
@@ -1150,18 +1150,49 @@
             </dc:macro>
             <dc:macro name="flood-map-qps">
               <dc:context>
+                <dc:comment>Grab only the actual first</dc:comment>
                 <dc:statement>
-                  SELECT count(*) as km_exists
-                  FROM cross_section_tracks WHERE river_id = ${river_id}
+                  SELECT DISTINCT
+                  cs.kind_id as kind_id,
+                  ck.name as kind_name
+                  FROM cross_section_tracks cs
+                  JOIN cross_section_track_kinds ck on cs.kind_id = ck.id
+                  WHERE river_id = ${river_id}
+                  AND kind_id=1
                 </dc:statement>
-                 <dc:elements>
-                  <dc:if test="$km_exists>0">
-                    <qps>
+                <dc:if test="dc:has-result()">
+                  <dc:elements>
+                    <actual>
+                      <dc:attribute name="description" value="${kind_name}"/>
                       <dc:attribute name="factory" value="wmsqpsfactory"/>
-                      <dc:attribute name="ids" value="${river_id}"/>
-                    </qps>
-                  </dc:if>
-                </dc:elements>
+                      <dc:attribute name="ids" value="${river_id};${kind_name};${kind_id}"/>
+                    </actual>
+                  </dc:elements>
+                </dc:if>
+              </dc:context>
+              <dc:context>
+                <dc:comment>Now the other tracks</dc:comment>
+                <dc:statement>
+                  SELECT DISTINCT
+                  cs.kind_id as kind_id,
+                  ck.name as kind_name,
+                  cs.name as layer_name
+                  FROM cross_section_tracks cs
+                  JOIN cross_section_track_kinds ck on cs.kind_id = ck.id
+                  WHERE river_id = ${river_id}
+                  AND kind_id=0
+                </dc:statement>
+                <dc:if test="dc:has-result()">
+                  <other>
+                    <dc:elements>
+                      <misc-qps>
+                        <dc:attribute name="description" value="${layer_name}"/>
+                        <dc:attribute name="factory" value="wmsqpsfactory"/>
+                        <dc:attribute name="ids" value="${river_id};${layer_name};${kind_id}"/>
+                      </misc-qps>
+                    </dc:elements>
+                  </other>
+                </dc:if>
               </dc:context>
             </dc:macro>
             <dc:macro name="flood-map-hydr-boundaries">
@@ -1517,7 +1548,6 @@
             </hws_points>
           </dc:macro>
 
-
           <dc:macro name="flood-map-buildings">
             <dc:context>
               <dc:statement>
@@ -1709,6 +1739,20 @@
               <dc:attribute name="ids" value="http://geoportal.bafg.de/wmsproxy/INSPIRE/DrainageBasin;HY.PHYSICALWATERS.CATCHMENTS;Einzugsgebiet"/>
             </dc:macro>
 
+            <dc:macro name="flood-map-routing">
+              <qps>
+                <dc:call-macro name="flood-map-qps"/>
+              </qps>
+              <riveraxis>
+                <dc:attribute name="factory" value="riveraxis"/>
+                <dc:attribute name="ids" value="${river_id}"/>
+              </riveraxis>
+              <dc:call-macro name="flood-map-km"/>
+              <fixpoints>
+                <dc:call-macro name="flood-map-fixpoints"/>
+              </fixpoints>
+            </dc:macro>
+
             <dc:macro name="flood-map-complete">
                 <buildings>
                   <dc:call-macro name="flood-map-buildings"/>
@@ -1716,25 +1760,18 @@
                 <catchments>
                   <dc:call-macro name="flood-map-catchments"/>
                 </catchments>
-                <fixpoints>
-                  <dc:call-macro name="flood-map-fixpoints"/>
-                </fixpoints>
+                <!-- TODO: HW-Marken -->
+                <hws>
+                  <dc:call-macro name="hwslines"/>
+                  <dc:call-macro name="hwspoints"/>
+                </hws>
+                <route_data>
+                  <dc:call-macro name="flood-map-routing"/>
+                </route_data>
                 <hydrboundaries>
                   <dc:call-macro name="flood-map-hydr-boundaries"/>
                   <dc:call-macro name="flood-map-floodplain"/>
                 </hydrboundaries>
-                <kilometrage>
-                    <riveraxis>
-                        <dc:attribute name="factory" value="riveraxis"/>
-                        <dc:attribute name="ids" value="${river_id}"/>
-                    </riveraxis>
-                  <dc:call-macro name="flood-map-km"/>
-                  <dc:call-macro name="flood-map-qps"/>
-                </kilometrage>
-                <hws>
-                  <dc:call-macro name="hwslines"/>
-                  <dc:call-macro name="hwspoints"/>
-                </hws>
                 <dc:call-macro name="flood-map-uesk"/>
                 <gaugelocations>
                   <dc:call-macro name="flood-map-gaugelocations"/>


More information about the Dive4elements-commits mailing list