Technical appendices

The following sections provide detailed technical information about Patchworks system internals.

Table of Contents

Patchworks Technical Support
Coverage
Availability
Reporting Bugs
Upgrades
Answers to Frequently Asked Questions
Licensing
Installation and Product Activation
Performance
Technical Support
Modelling with Patchworks
Target Troubles
Customizing Patchworks
XML Questions
Matrix Builder Questions
Woodstock Conversion Questions
ForestModel References
ForestModel — The main enclosing element for the ForestModel XML document
define — defines inventory fields and variables
assign — temporarily assigns values to fields
input — states input file fields for area and origin
output — defines output filenames
attribute — a curve that describes a feature or product related to selected stratum
attributes — collection of similar attributes
expression — A simple linear equation that describes the vertices that make up time series data
curve — describes the vertices that make up time series data
point — provides inflection points of a curve
curvetable — a column-oriented table of curves that make up time series data
column — specifies conversion parameters for a column in a curvetable
select — defines eligibility for a given stratum of inventory
succession — specifies overstory breakup timing, renewal timing and change in forest characteristics
track — a collection of possible treatments
treatment — define treatment type and response for a track selection
package — defines a treatment package composed of a sequence of treatments
produce — allows for assignment of stratification values during the resolution of product values
transition — update stratification values after a treatment has been applied
features — defines a collection of feature attributes
products — defines a collection of product attributes for the selection
retention — optional within block retention definition
Patchworks Applications
Compose Animation — Creates a GIF format animation from multiple input image files.
Dissolve Polygons — A simple polygon dissolve utility
Extract curves from an XML file — Extract curves from a ForestModel XML file, and saves the values in CSV format.
Generate Lattice — Create a lattice of line segments in ESRI generate format
GridASCII — Creates an ASCII format grid file from an ESRI binary grid file.
Console — The IProperties program opens a command console through which the user can execute scripts using a Java-like language.
Compute Zone Majority (raster) — A tool to compute overlaps between polygons in a base coverage and a zone coverage using a raster algorithm
Compute Zone Majority (vector)
Map Viewer — A general purpose map viewer tool
Build Road Segments
PolyGrid — Rasterize a polygon file
Matrix Builder
Proximal Topology (raster) — program to generate,using a raster based algorithm, polygon distances to neighbouring polygons.
Polygon Splitter — Program to split polygons into pieces
Proportional allocation — Calculates a proportional allocation for succession and treatment response outcomes based on the STRAP algorithm.
Inspect Tracks — Visually review track data sets.
SFMM Model Conversion — A program to convert SFMM input files to ForestModel XML format
Woodstock Model Conversion — Woodstock to ForestModel XML conversion wizard.
Patchworks Attributes Tables
The Block Attribute Table
The Target Table
The Performance Table
The Timing Constraints Table
Route Tables
The Network Table
Patchworks Query Language
Data Types
Forming Expressions
Functions
Mathematical functions
abs — Returns the absolute value of the input number.
ageclass — This functions will convert an age to an age class category.
ceil — Rounds a number up to the next nearest mathematical integer value.
exp — Returns e raised to the power of number
floor — Rounds a number down to the next nearest mathematical integer value.
inrange — Test if a numeric value is within to other values.
int — Converts the input number or string into an integer value.
isinfinite — Test if a value represents an infinite value.
isnan — Test if a value represents an invalid value (Not A Number).
log — Returns natural logarithm (base e) of a number
max — Returns the largest value in a set of values.
min — Returns the smallest value in a set of values.
number — Converts the input number or string into an double precision number value.
percent — Return the first value as a percentage of the second number.
pow — Return the result of a number raised to a power.
random — Return a pseudo random value between 0 and 1.
round — Returns the closest integer to the argument.
sqrt — Returns the correctly rounded positive square root of a number.
String functions
endswith — Tests if a string ends with the specified suffix.
format — Returns a formatted string using the specified format string and arguments.
indexof — Return the starting position of a substring within a string.
lastindexof — Return the starting position of a substring within a string, searching from the end forward.
left — Return the specified number of characters from the start of a string.
length — Return the length of a string.
lower — Convert a string to lower case.
matches — Tests if a string matches with a regular expression.
matchgroup — Extract a substring from a string using a regular expression.
replaceall — Return a string replacing all occurrences of one substring with another.
right — Return the specified number of characters from the end of a string.
spcomp — Return a percent species composition value from species composition string like used by the Ontario MNRF. In the alternate form encode a series of values in to a species composition string.
startswith — Tests if a string starts with the specified suffix.
string — Converts the input value into a string value.
substring — Returns a string that is a substring of this string.
trim — Trim white space from the beginning and ending of a string.
upper — Convert a string to upper case.
Lookup functions
lookuplist — Extract a value from a list.
lookuptable — Extract a value from a list.
map — Extract a value from a list.
range — Classifies a number in to a numeric range category.
Control functions
catch — Evaluate an expression and handle error conditions.
error — Raise an error condition.
if — Return alternate values depending on the value of a condition.
Curve functions
attribute — Return a reference to an attribute curve that has the matching attribute label.
attributeid — Return a reference to an attribute definition that has the matching id value.
curve — Return a curve defined by a series of X and Y points.
curvefloor — Reshape a curve to not have values descending below a floor value.
curveid — Return a reference to curve definition that has the matching id value.
curvemaxx — Return the highest x value in the curve.
curvemaxy — Return the highest y value in the curve.
curveminx — Return the lowest x value in the curve.
curveminy — Return the lowest y value in the curve.
discount — Return discount curve.
domainof — Return the first value on the domain axis for the specified value from the range axis.
lookupcurve — Return the interpolation of a value along a curve.
mai — Return a mean annual increment curve.
operable — Return a feature curve that is trimmed to the operable timing.
shiftcurve — Return a curve that has been shifted by a specified amount.
ytp — Return the age of the highest point along a curve.
List functions
list — Return a list of values.
split — Split a string and return a list of strings.
Data functions
area — Return the area of a polygon.
column — Return a value from the data table.
columntest — Return a value from the data table or a default expression.
dominantcolumn — Return the name of the column having the highest value.
getenv — Return the value of an environment variable.
getvar — Return the value of previously saved value.
length — Return the length of a line feature.
nonzerocolumn — Return the name of the first matching column having a nonzero value.
offset — Return the offset (year in the future) for the current calculation.
period — Return the planning period for the current calculation.
row — Return the data row number for the current calculation.
setvar — Evaluate an expression, save and return the value.
summarizecolumns — Add the values from all columns that match the regular expression.
summarizeperiods — Add the values of an exprssion over a set of periods.
year — Return the year in the future (offset) for the current calculation.
Selection functions
intersection — Return the set of features from the polygon table that are intersected by selected features in the network table.
neighbours — Return the set of polygon features that are neighbours of a selected set of polygon features.
selectbylocation — Return a selection of records based on a proximity to selected features in a second data source.
selected — Return a true if the record is in the selected set, false otherwise.
selection — Return a selection of records based on an expression.
Data type promotion
Examples
Regular Expressions
Report Syntax
Common Parameters to all Report Constructors
Index Report
Parameters and Constructors
Example PIN File Definition
Multiple Target Report
Parameters and Constructors
Example PIN File Definition
Target Limit Report
Parameters and Constructors
Example PIN File Definition
Text Report
Parameters and Constructors
Example PIN File Definition
Period Pattern Report
Parameters and Constructors
Example PIN File Definition
Period Category Report
Parameters and Constructors
Example PIN File Definition
Category Pattern Report
Parameters and Constructors
Example PIN File Definition
Category Category Report
Map Report
Parameters and Constructors
Example PIN File Definition
Patch Report
Parameters and Constructors
Example PIN File Definition
Objective Progress Report
Parameters and Constructors
Example PIN File Definition
Range Indicator Chart Report
Parameters and Constructors
Example PIN File Definition
Box and Whisker Chart Report
Parameters and Constructors
Route Cost Report
Parameters and Constructors
Example PIN File Definition
Table Query Report
Parameters and Constructors
Example PIN File Definition
Raster Remap Report
Parameters and Constructors
Patchworks script library
00_startup — Patchworks system initialization script.
adjustWeightsRelative — This script will adjust the weight values so that the accounts will compete against each other in an equitable manner.
analyze — These methods can be used to control the duration of a simulation.
analyze_safe — This method is similar the the analyze method, but it will periodically save out the scenario files in order to protect against power failures or other interuptions.
changeToScriptDirectory — This script will change the working directory into the directory of the active calling script.
clearTargets — This method will turn all targets to inactive.
confirm — This method will present a dialog box and query for an 'Ok' or 'Cancel' answer.
copyTable — Copy a table to a text file, in simple CSV format.
filterCSV — This routine will read a CSV file and create a copy that contains only the selected records.
findInFeaturesFile — This script will search through a 'features.
guiControl — This code in this method assists in controlling and customizing the Patchworks user interface.
loadScripts — This method will load all of the BeanShell scripts from a specified folder.
loadSrnvTargets — This script will assist in defining reports and setting targets for the Ontario Landscape Guide prescriptive indicators.
lockExclusives — Set the locking status for an exclusive account for all selected blocks in the block table.
makeAnimation — The methods in this file will create simple GIF animations from a series of images.
makeZip — These methods will create a Zip archive containing the contents of a specified folder.
maximizeSustainableYield — This method implements a binary-search sustainable harvest level calculator, written by Greg Paradis.
objective — The methods in this file are useful for setting up scenario automation using ScenarioSets.
pause — These methods will present a dialog box and pause until clicked.
reloadExclusiveLocks — Reload the all of exclusive account locks from a previously saved scenario.
reloadExclusives — Reload the all of exclusive account options from a previously saved scenario.
reloadRoutes — Reload the all of route files from a previously saved scenario.
reloadScenario — Reload the all of scenario data from a previously saved scenario.
reloadSchedule — Reload the schedule data from a previously saved scenario.
reloadTargets — Reload the target data from a previously saved scenario.
reloadTimingConstraints — Reload the timing constraint data from a previously saved scenario.
resaveReports — These methods are used to load up and save out scenarios.
safelyRenameFile — Rename a file to a backup, and then rename the replacement.
select — This script will present a dialog box and query for a list selection .
selectivelyCancelTreatments — This script will cancel treatments based on a selection criteria and a range of periods.
setActive — Toggle target activation status for target with label "label" @param label The target to set @param active The activation status to be set.
setInitialAnnual — These methods will set the initial target values of the specified target.
setInitialPeriodic — These methods will set the initial target values of the specified target.
setMaxWeight — These methods will set the maximum weight values of the specified target.
setMaximum — These methods will set the maximum target values of the specified target.
setMaximumAnnual — These methods will set the maximum target values of the specified target.
setMaximumPeriodic — These methods will set the maximum target values of the specified target.
setMinWeight — These methods will set the minimum weight values of the specified target.
setMinimum — These methods will set the minimum target values of the specified target.
setMinimumAnnual — These methods will set the minimum target values of the specified target.
setMinimumPeriodic — These methods will set the minimum target values of the specified target.
setOptions — This script will display a menu listing the BeanShell variables that were specified in the input list.
setTarget — This method will set the minimum and maximum target values of the specified target.
setTargetAnnual — This method will set the minimum and maximum target values of the specified target.
setTargetPeriodic — This method will set the minimum and maximum target values of the specified target.
showTargetMenu — Apply a list of targets.
simulate — Simple sequential simultion model.
sourceGlobal — Source a Beanshell script into the global context.
tempFile — These methods create unique, not previously used file names.
Advanced Scripting
Creating a Core Boundary — The Core Boundary script creates a shape file that contains core areas which include interspersions and inclusions.
Global Variables Used by the Patchworks System
Release notes
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
April 2019
March 2019
February 2019
January 2019
December 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
November 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
October 2013
August 2013
July 2013
June 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
April 2012
March 2012
February 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
March 2011
February 2011
January 2011
December 2010
November 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
November 2007
October 2007
September 2007
August 2007
July 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
August 2006
July 2006
May 2006
April 2006
March 2006
January 2006
December 2005
November 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
September 2004
August 2004
July 2004
June 2004
October 2003
September 2003
July 2003
June 2003
February 2003
September 2002
August 2002
July 2002
June 2002
March 2002
December 2001
November 2001
Copyright statements
Patchworks copyright, license and warranty
Third-Party Licenses
Apache POI
ASM
BeanShell
Cmocean Color Palettes
Color Brewer
iText
JFreeChart
JTS
RSyntaxTextArea
Java options