Using Attribute Sets to simplify the ForestModel XML

In the section above it was noted that ForestModels would be slightly more complex if they were to accurately represent the reality of the forest dynamics in the planning area. This increased complexity would require increased numbers of attributes to accurately describe stand dynamics. Adding numerous attributes like in our above example can become repititious and lengthy. However, similar attributes can be grouped into sets. These sets can then be used in <features> or <products> elements. Using attribute sets is a convenience feature to help simplify and reduce the effort required to build a ForestModel. You can still create features using the method in the first section, but sets are a more efficient way to express this information.

The following example will begin like the first example (notice the first three lines) but then we will define an attribute set to describe seral stages of forest stands, visual disturbances and yield information for a particular strata. These sets can then be used throughout the ForestModel by referring to the 'idref' in either features or products. These sets can be used exactly as they are, or can be modified using a number of the parameters in the <attributes> element to create a unique set of attributes.

Example 10.  Defining feature attributes using Attribute Sets

    <?xml version="1.0"?>
    <!DOCTYPE ForestModel SYSTEM "ForestModel.dtd">

    <ForestModel description="C5 Dataset" horizon="200" year="2002">

      <!--
        Identify columns of interest from the input inventory file.
      -->
      <define field="theme1" column="THEME1" />
      <define field="theme2" column="THEME2" />
      <define field="theme3" column="THEME3" />
      <define field="theme4" column="THEME4" />
      <define field="theme5" column="THEME5" />

      <!--
        Attribute set for visual quality.  One curve applies
        to all stand types.
      -->
      <attributes id="Visual">
        <attribute label="feature.Visual.disturbed" cycle="false">
          <curve id="Visual.disturb">
            <point x="5.0" y="1.0" />
            <point x="25.0" y="1.0" />
            <point x="26.0" y="1.0" />
            <point x="30.0" y="0.0" />
          </curve>
        </attribute>
      </attributes>

      <!--
        Attribute set for seral stage.  These curves apply
        to all 'PL' stand types.
      -->
      <attributes id="Seral.PL">
1      <attribute label="%f.Area.%t.PL">
          <curve>
            <point x="0.0" y="1.0" />
          </curve>
        </attribute>
        <attribute label="%f.Seral.regen">
          <curve>
            <point x="0.0" y="1.0" />
            <point x="25.0" y="1.0" />
            <point x="30.0" y="0.0" />
          </curve>
        </attribute>
        <attribute label="%f.Seral.young">
          <curve>
            <point x="25.0" y="0.0" />
            <point x="30.0" y="1.0" />
            <point x="80.0" y="1.0" />
            <point x="85.0" y="0.0" />
          </curve>
        </attribute>
        <attribute label="%f.Seral.mature">
          <curve>
            <point x="80.0" y="0.0" />
            <point x="85.0" y="1.0" />
            <point x="150.0" y="1.0" />
            <point x="155.0" y="0.0" />
          </curve>
        </attribute>
        <attribute label="%f.Seral.old">
          <curve>
            <point x="150.0" y="0.0" />
            <point x="155.0" y="1.0" />
          </curve>
        </attribute>
      </attributes>

      <!--
        Yield curves for yield strata Y4
      -->
      <attributes id="Volume.%t.Y4">
        <attribute label="%f.Yield.%t.Decid">
          <curve>
            <point x="5.0" y="0.0" />
            <point x="20.0" y="0.17" />
            <point x="30.0" y="0.85" />
            <point x="35.0" y="1.47" />
            <point x="45.0" y="3.29" />
            <point x="70.0" y="9.37" />
            <point x="80.0" y="11.38" />
            <point x="90.0" y="12.73" />
            <point x="95.0" y="13.13" />
            <point x="105.0" y="13.39" />
            <point x="115.0" y="13.03" />
            <point x="125.0" y="12.19" />
            <point x="180.0" y="5.18" />
            <point x="195.0" y="3.71" />
            <point x="215.0" y="2.27" />
            <point x="235.0" y="1.32" />
            <point x="260.0" y="0.64" />
            <point x="290.0" y="0.25" />
            <point x="325.0" y="0.18" />
          </curve>
        </attribute>
        <attribute label="%f.Yield.%t.Conif">
          <curve>
            <point x="5.0" y="8.85" />
            <point x="40.0" y="111.33" />
            <point x="65.0" y="169.93" />
            <point x="90.0" y="207.76" />
            <point x="105.0" y="221.41" />
            <point x="120.0" y="229.31" />
            <point x="145.0" y="232.14" />
            <point x="175.0" y="223.18" />
            <point x="215.0" y="198.99" />
            <point x="300.0" y="134.96" />
          </curve>
        </attribute>
      </attributes>

      <!--
        Block attributes
        Include attributes that describe the development characterics
        of this block
      -->
      <select statement="theme2 eq 'Y4' and theme5 eq 'PL'">
        <features>
          <attributes idref="Visual" />
          <attributes idref="Seral.PL" />
          <attributes idref="Yield.Y4" />
        </features>
      </select>

    </ForestModel> 
	

In our select statement at the bottom of the example we were able to identify a particular record and assign 8 feature attributes using only three <attributes>. Using sets of attributes not only organizes lengthy files but saves time in the long run. The entire collection of attribute curves referred to by the attributes idref can be scaled back by defining a factor attribute, to further reduce the amount of repitition within the XML file.

1

The use of the symbols %f and %t (or %m) in the attribute labels is another time saving feature of the ForestModel syntax. When %f is used in an attribute label and then used in a <feature> element, the word feature is substituted in its place for the attribute name. If however this same attribute is used in a <product> element, the word product is substituted in the attribute name. This allows the same attribute curves to be used to describe both features and products without having to define individual curves. Although the same curve is being used, it can be factored and modified using other attributes within the <attributes> element.

The substitution symbol %t (or %m) can also be used in the attribute label to be substituted for either managed or unmanaged, depending on where it appears in the ForestModel XML. Again, this reduces repitition in attribute curve definition and also maintains a consistent attribute nomeclature scheme throughout the dataset.