diff flys-artifacts/doc/conf/meta-data.xml @ 5631:ca4b6263996c

Added old calculations to datacage 'M-INFO Sedimentfracht'. * Added facets to artifact config. * Added macros to datacage config. * Create subfolders for old calculations in datacage. * New outputs in sediment load generator.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 10 Apr 2013 15:04:56 +0200
parents 2d9eb188fa51
children dc731d2937f9
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/meta-data.xml	Wed Apr 10 14:51:57 2013 +0200
+++ b/flys-artifacts/doc/conf/meta-data.xml	Wed Apr 10 15:04:56 2013 +0200
@@ -611,6 +611,33 @@
           </soundings_width>
         </dc:macro>
 
+        <dc:macro name="morph_width">
+          <morph-width>
+            <dc:context>
+              <dc:statement>
+                SELECT id   AS width_id
+                FROM morphologic_width
+                WHERE river_id = ${river_id}
+              </dc:statement>
+              <dc:for-each>
+                <dc:context>
+                  <dc:statement>
+                    SELECT min(station) AS from,
+                           max(station) AS to
+                    FROM morphologic_width_values
+                    WHERE morphologic_width_id = ${width_id}
+                  </dc:statement>
+                  <dc:for-each>
+                    <morphologic-width name="{$from} - {$to}"
+                                       ids="{$width_id}"
+                                       factory="morph-width"/>
+                  </dc:for-each>
+                </dc:context>
+              </dc:for-each>
+            </dc:context>
+          </morph-width>
+        </dc:macro>
+
         <dc:macro name="longitudinal-section-prototype">
           <dc:call-macro name="basedata_0"/>
           <dc:call-macro name="basedata_1_additionals"/>
@@ -732,6 +759,10 @@
             <dc:if test="dc:contains($artifact-outs, 'bed_longitudinal_section')">
               <dc:call-macro name="annotations_per_type"/>
             </dc:if>
+            <dc:if test="dc:contains($artifact-outs, 'sedimentload_ls')">
+              <dc:call-macro name="annotations_per_type"/>
+              <dc:call-macro name="morph_width"/>
+            </dc:if>
             <dc:comment>
               MINFO bedheight middle
             </dc:comment>
@@ -2512,27 +2543,40 @@
                     <dc:call-macro name="range-filter">
                       <dc:context>
                         <dc:statement>
-                          SELECT a.gid         AS aid,
-                                 f.id          AS fid,
-                                 f.name        AS facet_name,
-                                 f.num         AS facet_num,
-                                 f.description AS facet_description
-                          FROM outs AS o, facets AS f, artifacts AS a
+                          SELECT id AS oid
+                          FROM outs AS o
                           WHERE
-                            (f.name = 'bed_longitudinal_section.bed_diameter_toplayer'
-                             OR f.name = 'bed_longitudinal_section.bed_diameter_sublayer') AND
-                             f.out_id = o.id         AND
-                             o.artifact_id = ${a_id} AND
-                             a.id = ${a_id}
+                            o.artifact_id = ${a_id} AND
+                            o.name='bed_longitudinal_section'
                         </dc:statement>
                         <dc:for-each>
-                          <dc:element name="${facet_name}">
-                            <dc:attribute name="factory" value="minfo"/>
-                            <dc:attribute name="description" value="${facet_description}"/>
-                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                            <dc:attribute name="artifact-id" value="${aid}"/>
-                            <dc:attribute name="out" value="bed_longitudinal_section"/>
-                          </dc:element>
+                          <quality-bed description="{$river} {$a_creation} {$collection_name}">
+                            <dc:context>
+                              <dc:statement>
+                                SELECT a.gid         AS aid,
+                                       f.id          AS fid,
+                                       f.name        AS facet_name,
+                                       f.num         AS facet_num,
+                                       f.description AS facet_description
+                                FROM outs AS o, facets AS f, artifacts AS a
+                                WHERE
+                                  (f.name = 'bed_longitudinal_section.bed_diameter_toplayer'
+                                   OR f.name = 'bed_longitudinal_section.bed_diameter_sublayer') AND
+                                   f.out_id = o.id         AND
+                                   o.artifact_id = ${a_id} AND
+                                   a.id = ${a_id}
+                              </dc:statement>
+                              <dc:for-each>
+                                <dc:element name="${facet_name}">
+                                  <dc:attribute name="factory" value="minfo"/>
+                                  <dc:attribute name="description" value="${facet_description}"/>
+                                  <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                                  <dc:attribute name="artifact-id" value="${aid}"/>
+                                  <dc:attribute name="out" value="bed_longitudinal_section"/>
+                                </dc:element>
+                              </dc:for-each>
+                            </dc:context>
+                          </quality-bed>
                         </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
@@ -2548,26 +2592,39 @@
                     <dc:call-macro name="range-filter">
                       <dc:context>
                         <dc:statement>
-                          SELECT a.gid         AS aid,
-                                 f.id          AS fid,
-                                 f.name        AS facet_name,
-                                 f.num         AS facet_num,
-                                 f.description AS facet_description
-                          FROM outs AS o, facets AS f, artifacts AS a
+                          SELECT id AS oid
+                          FROM outs AS o
                           WHERE
-                             f.name = 'bed_longitudinal_section.bedload_diameter' AND
-                             f.out_id = o.id         AND
-                             o.artifact_id = ${a_id} AND
-                             a.id = ${a_id}
+                            o.artifact_id = ${a_id} AND
+                            o.name='bed_longitudinal_section'
                         </dc:statement>
                         <dc:for-each>
-                          <dc:element name="${facet_name}">
-                            <dc:attribute name="factory" value="minfo"/>
-                            <dc:attribute name="description" value="${facet_description}"/>
-                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                            <dc:attribute name="artifact-id" value="${aid}"/>
-                            <dc:attribute name="out" value="bed_longitudinal_section"/>
-                          </dc:element>
+                          <quality-load description="{$river} {$a_creation} {$collection_name}">
+                            <dc:context>
+                              <dc:statement>
+                                SELECT a.gid         AS aid,
+                                       f.id          AS fid,
+                                       f.name        AS facet_name,
+                                       f.num         AS facet_num,
+                                       f.description AS facet_description
+                                FROM outs AS o, facets AS f, artifacts AS a
+                                WHERE
+                                   f.name = 'bed_longitudinal_section.bedload_diameter' AND
+                                   f.out_id = o.id         AND
+                                   o.artifact_id = ${a_id} AND
+                                   a.id = ${a_id}
+                              </dc:statement>
+                              <dc:for-each>
+                                <dc:element name="${facet_name}">
+                                  <dc:attribute name="factory" value="minfo"/>
+                                  <dc:attribute name="description" value="${facet_description}"/>
+                                  <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                                  <dc:attribute name="artifact-id" value="${aid}"/>
+                                  <dc:attribute name="out" value="bed_longitudinal_section"/>
+                                </dc:element>
+                              </dc:for-each>
+                            </dc:context>
+                          </quality-load>
                         </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
@@ -2581,29 +2638,42 @@
                 <dc:for-each>
                   <dc:context>
                     <dc:call-macro name="range-filter">
-                      <dc:context>
-                        <dc:statement>
-                          SELECT a.gid         AS aid,
-                                 f.id          AS fid,
-                                 f.name        AS facet_name,
-                                 f.num         AS facet_num,
-                                 f.description AS facet_description
-                          FROM outs AS o, facets AS f, artifacts AS a
-                          WHERE
-                             (f.name = 'bed_longitudinal_section.sediment_density_toplayer' OR
-                              f.name = 'bed_longitudinal_section.sediment_density_sublayer') AND
-                             f.out_id = o.id         AND
-                             o.artifact_id = ${a_id} AND
-                             a.id = ${a_id}
-                        </dc:statement>
-                        <dc:for-each>
-                          <dc:element name="${facet_name}">
-                            <dc:attribute name="factory" value="minfo"/>
-                            <dc:attribute name="description" value="${facet_description}"/>
-                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                            <dc:attribute name="artifact-id" value="${aid}"/>
-                            <dc:attribute name="out" value="bed_longitudinal_section"/>
-                          </dc:element>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT id AS oid
+                        FROM outs AS o
+                        WHERE
+                          o.artifact_id = ${a_id} AND
+                          o.name='bed_longitudinal_section'
+                      </dc:statement>
+                      <dc:for-each>
+                        <density description="{$river} {$a_creation} {$collection_name}">
+                            <dc:context>
+                              <dc:statement>
+                                SELECT a.gid         AS aid,
+                                       f.id          AS fid,
+                                       f.name        AS facet_name,
+                                       f.num         AS facet_num,
+                                       f.description AS facet_description
+                                FROM outs AS o, facets AS f, artifacts AS a
+                                WHERE
+                                   (f.name = 'bed_longitudinal_section.sediment_density_toplayer' OR
+                                    f.name = 'bed_longitudinal_section.sediment_density_sublayer') AND
+                                   f.out_id = o.id         AND
+                                   o.artifact_id = ${a_id} AND
+                                   a.id = ${a_id}
+                              </dc:statement>
+                              <dc:for-each>
+                                <dc:element name="${facet_name}">
+                                  <dc:attribute name="factory" value="minfo"/>
+                                  <dc:attribute name="description" value="${facet_description}"/>
+                                  <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                                  <dc:attribute name="artifact-id" value="${aid}"/>
+                                  <dc:attribute name="out" value="bed_longitudinal_section"/>
+                                </dc:element>
+                              </dc:for-each>
+                            </dc:context>
+                          </density>
                         </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
@@ -2619,27 +2689,40 @@
                     <dc:call-macro name="range-filter">
                       <dc:context>
                         <dc:statement>
-                          SELECT a.gid         AS aid,
-                                 f.id          AS fid,
-                                 f.name        AS facet_name,
-                                 f.num         AS facet_num,
-                                 f.description AS facet_description
-                          FROM outs AS o, facets AS f, artifacts AS a
+                          SELECT id AS oid
+                          FROM outs AS o
                           WHERE
-                             (f.name = 'bed_longitudinal_section.porosity_toplayer' OR
-                              f.name = 'bed_longitudinal_section.porosity_sublayer') AND
-                             f.out_id = o.id         AND
-                             o.artifact_id = ${a_id} AND
-                             a.id = ${a_id}
+                            o.artifact_id = ${a_id} AND
+                            o.name='bed_longitudinal_section'
                         </dc:statement>
                         <dc:for-each>
-                          <dc:element name="${facet_name}">
-                            <dc:attribute name="factory" value="minfo"/>
-                            <dc:attribute name="description" value="${facet_description}"/>
-                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                            <dc:attribute name="artifact-id" value="${aid}"/>
-                            <dc:attribute name="out" value="bed_longitudinal_section"/>
-                          </dc:element>
+                          <porosity description="{$river} {$a_creation} {$collection_name}">
+                            <dc:context>
+                              <dc:statement>
+                                SELECT a.gid         AS aid,
+                                       f.id          AS fid,
+                                       f.name        AS facet_name,
+                                       f.num         AS facet_num,
+                                       f.description AS facet_description
+                                FROM outs AS o, facets AS f, artifacts AS a
+                                WHERE
+                                   (f.name = 'bed_longitudinal_section.porosity_toplayer' OR
+                                    f.name = 'bed_longitudinal_section.porosity_sublayer') AND
+                                   f.out_id = o.id         AND
+                                   o.artifact_id = ${a_id} AND
+                                   a.id = ${a_id}
+                              </dc:statement>
+                              <dc:for-each>
+                                <dc:element name="${facet_name}">
+                                  <dc:attribute name="factory" value="minfo"/>
+                                  <dc:attribute name="description" value="${facet_description}"/>
+                                  <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                                  <dc:attribute name="artifact-id" value="${aid}"/>
+                                  <dc:attribute name="out" value="bed_longitudinal_section"/>
+                                </dc:element>
+                              </dc:for-each>
+                            </dc:context>
+                          </porosity>
                         </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
@@ -2655,29 +2738,41 @@
                     <dc:call-macro name="range-filter">
                       <dc:context>
                         <dc:statement>
-                          SELECT a.gid         AS aid,
-                                 f.id          AS fid,
-                                 f.name        AS facet_name,
-                                 f.num         AS facet_num,
-                                 f.description AS facet_description
-                          FROM outs AS o, facets AS f, artifacts AS a
+                          SELECT id AS oid
+                          FROM outs AS o
                           WHERE
-                            (f.name = 'flow_velocity.totalchannel' OR
-                             f.name = 'flow_velocity.mainchannel' OR
-                             f.name = 'flow_velocity.totalchannel.filtered' OR
-                             f.name = 'flow_velocity.mainchannel.filtered') AND
-                             f.out_id = o.id         AND
-                             o.artifact_id = ${a_id} AND
-                             a.id = ${a_id}
+                            o.artifact_id = ${a_id} and o.name='flow_velocity'
                         </dc:statement>
                         <dc:for-each>
-                          <dc:element name="${facet_name}">
-                            <dc:attribute name="factory" value="minfo"/>
-                            <dc:attribute name="description" value="${facet_description}"/>
-                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                            <dc:attribute name="artifact-id" value="${aid}"/>
-                            <dc:attribute name="out" value="bed_longitudinal_section"/>
-                          </dc:element>
+                          <flow description="{$river} {$a_creation} {$collection_name}">
+                          <dc:context>
+                            <dc:statement>
+                              SELECT a.gid         AS aid,
+                                     f.id          AS fid,
+                                     f.name        AS facet_name,
+                                     f.num         AS facet_num,
+                                     f.description AS facet_description
+                              FROM outs AS o, facets AS f, artifacts AS a
+                              WHERE
+                                (f.name = 'flow_velocity.totalchannel' OR
+                                 f.name = 'flow_velocity.mainchannel' OR
+                                 f.name = 'flow_velocity.totalchannel.filtered' OR
+                                 f.name = 'flow_velocity.mainchannel.filtered') AND
+                                 f.out_id = o.id         AND
+                                 o.artifact_id = ${a_id} AND
+                                 a.id = ${a_id}
+                            </dc:statement>
+                            <dc:for-each>
+                              <dc:element name="${facet_name}">
+                                <dc:attribute name="factory" value="minfo"/>
+                                <dc:attribute name="description" value="${facet_description}"/>
+                                <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                                <dc:attribute name="artifact-id" value="${aid}"/>
+                                <dc:attribute name="out" value="flow_velocity"/>
+                              </dc:element>
+                            </dc:for-each>
+                          </dc:context>
+                        </flow>
                         </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
@@ -2686,6 +2781,109 @@
               </flow-velocity>
             </dc:macro>
 
+            <dc:macro name="sediment-load">
+              <sediment-load>
+                <dc:for-each>
+                  <dc:context>
+                    <dc:call-macro name="range-filter">
+                      <dc:context>
+                        <dc:statement>
+                          SELECT id AS oid
+                          FROM outs AS o
+                          WHERE
+                            o.artifact_id = ${a_id} and o.name='sedimentload_ls'
+                        </dc:statement>
+                        <dc:for-each>
+                          <load description="{$river} {$a_creation} {$collection_name}">
+                            <dc:context>
+                              <dc:statement>
+                                SELECT a.gid         AS aid,
+                                       f.id          AS fid,
+                                       f.name        AS facet_name,
+                                       f.num         AS facet_num,
+                                       f.description AS facet_description
+                                FROM outs AS o, facets AS f, artifacts AS a
+                                WHERE f.name LIKE 'sedimentload%' AND
+                                      f.out_id = o.id         AND
+                                      o.artifact_id = ${a_id} AND
+                                      a.id = ${a_id}
+                              </dc:statement>
+                              <dc:for-each>
+                                <dc:element name="${facet_name}">
+                                  <dc:attribute name="factory" value="minfo"/>
+                                  <dc:attribute name="description" value="${facet_description}"/>
+                                  <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                                  <dc:attribute name="artifact-id" value="${aid}"/>
+                                  <dc:attribute name="out" value="sedimentload_ls"/>
+                                </dc:element>
+                              </dc:for-each>
+                            </dc:context>
+                          </load>
+                        </dc:for-each>
+                      </dc:context>
+                    </dc:call-macro>
+                  </dc:context>
+                </dc:for-each>
+              </sediment-load>
+            </dc:macro>
+
+            <dc:macro name="bedheight-differences">
+              <bedheight-differences>
+                <dc:for-each>
+                  <dc:context>
+                    <dc:call-macro name="range-filter">
+                      <dc:context>
+                        <dc:statement>
+                          SELECT id AS oid,
+                                 name AS o_name
+                          FROM outs AS o
+                          WHERE
+                            o.artifact_id = ${a_id} AND
+                            (o.name = 'bed_difference_year' OR
+                             o.name = 'bed_differnece_epoch')
+                        </dc:statement>
+                        <dc:for-each>
+                          <difference description="{$river} {$a_creation} {$collection_name}">
+                            <dc:context>
+                              <dc:statement>
+                                SELECT a.gid         AS aid,
+                                       f.id          AS fid,
+                                       f.name        AS facet_name,
+                                       f.num         AS facet_num,
+                                       f.description AS facet_description
+                                FROM outs AS o, facets AS f, artifacts AS a
+                                WHERE (f.name LIKE 'bedheight_difference.year%' OR
+                                       f.name LIKE 'bedheight_difference.epoch%') AND
+                                      f.out_id = o.id         AND
+                                      o.artifact_id = ${a_id} AND
+                                      a.id = ${a_id}
+                              </dc:statement>
+                              <dc:for-each>
+                                <dc:element name="${facet_name}">
+                                  <dc:attribute name="factory" value="minfo"/>
+                                  <dc:attribute name="description" value="${facet_description}"/>
+                                  <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                                  <dc:attribute name="artifact-id" value="${aid}"/>
+                                  <dc:choose>
+                                    <dc:when test="dc:contains($o_name, 'bed_difference_year')">
+                                      <dc:attribute name="out" value="bed_difference_year"/>
+                                    </dc:when>
+                                    <dc:otherwise>
+                                      <dc:attribute name="out" value="bed_difference_epoch"/>
+                                    </dc:otherwise>
+                                  </dc:choose>
+                                </dc:element>
+                              </dc:for-each>
+                            </dc:context>
+                          </difference>
+                        </dc:for-each>
+                      </dc:context>
+                    </dc:call-macro>
+                  </dc:context>
+                </dc:for-each>
+              </bedheight-differences>
+            </dc:macro>
+
 
             <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))">
               <dc:call-macro name="longitudinal"/>
@@ -2742,6 +2940,12 @@
               <dc:call-macro name="bedquality-density"/>
               <dc:call-macro name="bedquality-porosity"/>
             </dc:if>
+            <dc:if test="dc:contains($artifact-outs, 'sedimentload_ls')">
+              <dc:call-macro name="differences"/>
+              <dc:call-macro name="bedheight-differences"/>
+              <dc:call-macro name="flow-velocity"/>
+              <dc:call-macro name="sediment-load"/>
+            </dc:if>
           </dc:context>
         </dc:call-macro>
 

http://dive4elements.wald.intevation.org