EGU General Assembly 2013: The new g.infer add-on for GRASS GIS
1. g.infer: A GRASS GIS Module for rule-based data-driven
Classification and Workflow Control
Peter Löwe GISIX.com, Potsdam, Germany
Contact: loewe@gisix.com
Abstract
g.infer is a new add-on module for GRASS GIS (V6.4.x /V.7.0) to compose
flexible rule-driven GIS workflows based on GRASS modules. The module
enables rule-based analysis and workflow management using data-driven
inference processes based on the C Language Integrated Production System
(CLIPS). G.infer supports raster, volume and point vector GIS-layers. GRASS
GIS environment variables can also be queried and manipulated. Built-in rule-
base templates allow the quick set-up of expert systems and workflows in GIS
environments. An interactive mode enables direct interaction with the rule-
base environment on the fly.
Application scenarios range from rule-based classification tasks, event-driven
workflow-control to complex simulations for tasks such as Soil Erosion
Monitoring and Disaster Early Warning
Expert Systems for GIS Applications
Knowledge-based systems, also known as Expert Systems, facilitate the encoding of
human knowledge for automated reasoning or inference, i.e., the processing of data
to infer conclusions, which can be mapped out in a GIS. The overall process of
making human expertise available through an Expert System is called Knowledge
Engineering. A rule-based software toolkit (Production Rule System toolkit) for the
implementation of Expert System instances for specific knowledge-domains is the
core of g.infer: The C Language Integrated Production System (CLIPS) project
was started by NASA (Johnson Space Center) in 1985. It is currently hosted at
Sourceforge (clipsrules.sourceforge.net/). CLIPS is integrated in g.infer via the
PyCLIPS Python module (pyclips.sourceforge.net/).
Rule-based GIS workflows
In GIS, the development of such „map-making“ workflows is usually handled by
stepwise execution of the consecutive processing steps by a human operator, to
create and document the unfolding workflow, by interacting with the actual spatial
data. Once a mapping workflow has been laid out, the next step is automatization,
turning it into software. This can involve scripting, i.e. the definition of an execution-
chain of available GIS modules, or programming, which includes the development of
new GIS modules. Free and Open Source GIS like GRASS GIS allow rapid
development of both solutions as the overall codebase can be exploited. However, if
a mapping workflow can be formulated by the human GIS operator, but can not be
implemented as script or GIS module, there’s a problem.
Challenging GIS workflows:
•Classification tasks which may not appear demanding, but no robust way for building
a solution can be defined in acceptable time and effort.
•Simple workflows, where the processing rules keep changing depending on the
available input and other parameters.
•Problems which have not fully understood or are very complex to solve.
Benefits of rule-based programming:
•Rule-based modeling allows to focus on “What to Do” instead of “How to do It”.
•Rules allow to express solutions to complex problems and to verify them
consequently by logging and retracing the decision steps leading to a particular
solution.
•Separation of logic (“know-how”) and data allows to keep the know-how to be
stored in centralized rule-bases, providing a central point of access for further editing
and improvement.
•Human-readable rules serve as their own documentation and can be reviewed by
domain experts.
Figure 1: Interaction of the g.infer module with related GRASS GIS components and the CLIPS
Production Rule System. Human experts (shown as figurines) can interact with this work
environment independently on multiple levels.
Figure 2: Overview of the interactions between the GRASS GIS environment (green), the CLIPS-
based inference environment (blue) and external data sources (grey), highlighting (red) the
potential for workflow control to be excerted by the inference process.
Figure 3: Graphical User Interfaces of g.infer for the import of GIS data
(top), settings of the CLIPS inference engine (center) and output options
(bottom).