XML Forest Models

Getting an input dataset ready for Patchworks is the most important and time consuming step in an analysis, due to the shear complexity, variation and size of inventory information, silvicultural ground rules, and forest dynamics.

To help simplify and speed up the procedure, Patchworks uses an XML-based modelling language as a recipe for generating an input dataset. The XML ForestModel provides instructions to the Patchworks Matrix Builder on how to create the core input files for the model: features, curves, products, treatments and tracknames. These files and their relationships are explained in the chapter Patchworks Data Model.

The Matrix Builder performs two important functions:

The Matrix Builder does not select management treatments for specific blocks, it simply compiles all the possiblities for each block and creates the core input files for the Patchworks scheduler. Management treatments are selected by the Patchworks scheduler from the array of options that are available. The use of the Matrix Builder is a time saving procedure for building the required Patchworks files. The ForestModel recipe is a more concise and flexible representation of growth and yield and forest dynamics than the detailed input matrix files.

The XML ForestModel structure and syntax is fairly straightforward and easy to work with as an intermediate format between various inventory structures and Patchworks. There are only a handful of key elements in the ForestModel document type, however due to the complexity and size of most planning problems a large number of yield curves and management actions increases the size of the XML ForestModel in a hurry!

It is possible to build an XML ForestModel from scratch just by editing a document in a word processor, or programatically by developing a script or macro. Patchworks includes utilities that convert exisiting aspatial model input files such as those from Woodstock and Strategic Forest Management Model (SFMM) into the ForestModel format. A typical use would be to use the conversion tools to get a preliminary ForestModel from an existing Woodstock or SFMM model, and then make changes and adjustments from this starting point (see Figure 175, “Data Flow Diagram”).

[Important]Important

It's important to keep in mind that only in rare circumstances will you be creating your own Patchworks xml file from scratch. You will most likely be using a converted SFMM or Woodstock input file and then editing the resulting xml file it as necessary. We present the following so you will understand what you see in your resulting xml file.

Figure 175. Data Flow Diagram


This chapter will run through simple examples of XML ForestModels to introduce the definition and syntax of important elements and their attributes. As the chapter progresses, new elements will be added to build on the example file and eventually provide all the ingredients needed for a working XML ForestModel.

The ForestModel References (see ForestModel References) provides a far more detailed and exhaustive discussion of each element in the ForestModel and will be an indispensible tool for model developers. Each reference describes the syntax and usage of individual elements, and provides examples of how the element is used in a ForestModel file.

[Tip]Tip

The ForestModel is formally described by a document type definition (DTD). Advanced programmers who would like to 'cut to the chase' can find a copy of the DTD in the Patchworks installation folder. For the rest of us - follow along as we begin our tour of the ForestModel!