TerraME: Multiparadigm Modeling Toolkit

TerraME is a programming environment for spatial dynamical modelling. It supports cellular automata, agent-based models, and network models running in 2D cell spaces. TerraME provides an interface to TerraLib geographical database, allowing models direct access to geospatial data. Its modelling language has in-built functions that makes it easier to develop multi-scale and multi-paradigm models for environmental applications.

Two important innovations in TerraME are its use of anisotropic spaces and of hybrid automata models. Anisotropic spaces arise when modeling natural and human-related phenomena. For example, land settlers in a new area do not occupy all places at the same time. They follow roads and rivers, leading to an anisotropic pattern. Anisotropic spaces are implemented in TerraME using Generalized Proximity Matrices (GPM). The GPM is an extension of the usual definition of the spatial relations and include a combination of neighborhood measures in the absolute space and in the relative space.

A hybrid automaton is an abstract model for a system whose behavior has discrete and continuous parts. It extends the idea of finite automata to allow continuous change to take place between transitions. Adopting hybrid automata in spatial dynamical models allows complex models which include critical transitions.

A vision of research motivations and directions of Environmental Modelling in INPE is available in this presentation. An early presentation of our vision is How can GIScience contribute to Land Change Modelling?, the keynote speech at GIScience 2006. The rationale for the TerraME software is presented in the lecture Modelling human-environment interactions, presented in the Vespucci Summer School 2010.


The latest version of TerraME is 2.0-beta-3 (Released on 4 Aug 2016). It has installers for Windows and Mac and must be compiled in Linux.



Examples and Documentation

  • You can run examples directly in the graphical interface of TerraME. Click in the Desktop icon to open it in Windows or run “terrame” in the command line to open the graphical interface. From the graphical interface it is also possible to see the documentation and to install other packages with additional examples.


  • We use TerraME on our courses on Enviromental Modelling. We give regular graduate courses in the research programs in Earth System Science at INPE and Computer Science at UFOP.

Papers and reports


  • The C++ source code documentation is available here.
  • List of known bugs.

Development kits

You can implement models in TerraME using any text file editor of your preference, such as Notepad++, Vim or Emacs. Below there is a list of editors we recommend due to their programming facilities.

  • Crimson Editor: Recommended for most users.
    • Instructions for running TerraME within Crimson.
    • Syntax highlight configuration file for TerraME. Put it in the “spec” directory within Crimson installation directory. For example, “C:\Program Files (x86)\Emerald Editor Community\Crimson Editor SVN286M\spec”.
  • Sublime: Recommended for Mac users.
    • Instructions for running TerraME within Sublime under Mac OS.
    • Under Windows:
      1. Download the compressed configuration files and uncompress them.
      2. Supposing that TerraME is installed in the folder “c:\TerraME” change the second line of “TerraME.sublime-build” file to: “cmd”: [“c:\\TerraME\\bin\\TerraME”, “$file”]
      3. Copy file “Lua.tmLanguage” to the folder “C:\Users\?USER_NAME?\AppData\Roaming\Sublime Text 2\Packages\Lua”
      4. Copy file “TerraME.sublime-build” to the folder “C:\Users\?USER_NAME?\AppData\Roaming\Sublime Text 2\Packages\User”
  • Eclipse SDK: Recommended for large projects. TerraME has an Eclipse plugin to visually develop models, called TerraME-GIMS: Graphical Interface for Modeling and Simulation.


TerraView is a GIS application based on TerraLib, a library to handle vector and raster data in several geographical DBMS. TerraME currently works with TerraView 4.2.0. Some useful plugins to work with dynamic models that come within TerraView are:

  • Fill Cell Plugin: Feeds cellular spaces with attributes based on any geometry, through a large set of operations.
  • Copytheme2layer: A simple and useful plugin to interchange cellular spaces from different databases.


The DataBase Management Systems (DBMS) currently supported by TerraME are:

  • Microsoft Access: Recommended for small projects. It usually comes installed on Windows.
  • MySQL: Recommended for large projects.

Statistical analysis

aRT (R-TerraLib API) is an R package that provides the integration between the statistical software R and the GIS library TerraLib. The aim is to have a package for accessing geospatial data to be analysed in R.


  • LUCCME, an extension for top-down land change modeling.


The chief developer of TerraME is Prof. Tiago Garcia de Senna Carneiro, from the Federal University of Ouro Preto (UFOP). INPE's development group includes Dr. Pedro Andrade, and MsC. Raian Vargas Maretto. INPE's researchers involved in developing models using TerraME include Dr. Gilberto Camara, Dr. Antonio Miguel Monteiro, Dr. Ana Paula Aguiar, Dr. Giovana Mira de Espindola, and PhD candidates Sergio Costa and Rodolfo Maduro Almeida. The TerraME kernel development team includes some research assistants from UFOP - Msc. Rodrigo Reis Pereira and Msc. Tiago Franca de Melo Lima, and also includes some undergraduate and master students from UFOP Computer Science Department: Antônio José da Cunha Rodrigues, Saulo Henrique Cabral Silva, Henrique Cota Camello, Washington Sena de França , Rafael Lage Moreira Barbosa , and Breno de Almeida Pereira. TerraME model calibration tools are being developed in association with researches and master students from the Eletrical Engineering Department from Federal University of Minas Gerais: Dr. Frederico Gadelha Guimarãesand Rodolfo Ayala Lopes Costa.

Supporting Software

The TerraME modelling language is an extension of the Lua programming language and interfaces to http://www.terralib.org GIS library for archival and retrieval of geospatial data. Many thanks to the Lua and TerraLib teams for providing such good environments to build upon!



TerraME has been developed as a joint effort among TerraLab (Laboratory for Modelling and Simulation of Earth Systems), at Federal University of Ouro Preto, with Earth System Science Center (CCST) and Image Processing Division (DPI), at INPE.


Locations of visitors to this page

QR Code
QR Code TerraME: Multiparadigm Modeling Toolkit (generated for current page)