Let's Renew Grass

Petri nets-based Image Processing

Introduction

Here, the required steps to compile and configure Grass GIS (version 6) from source are listed. Installing from the binaries affects negatively on the plugin, since the commands wrapper will not work properly. We also explain how to set up the required variables as well as how to organize the data in a Grass database.

Install Grass GIS from source:

The following steps are for Linux-based systems.

First we need to download a copy of the source code. For this, svn (a revision control system) should to be installed.

$ sudo apt-get install svn
After a successful install of svn run:

$ sudo svn checkout https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4 grass64_release
After downloading the code, we need to compile it. There are many dependencies, which are necessary for Grass compilation for example: PROJ.4, GEOS and GDAL. Grass need to be configured before running (make and make install) by executing the configure command. This generates a file with all the variables (can/should be adjusted according to specific needs) that they will be used in the compilation phase.
This is an example configuration (which can/should be adjusted according to specific needs):
CFLAGS="-O2 -Wall" LDFLAGS="-s" ./configure \
--enable-largefile=yes \
--with-nls \
--with-cxx \
--with-proj-share=/usr/local/share/proj/ \
--with-geos=/usr/lo\\cal/bin/geos-config \
--with-readline \
--with-python=yes \
--with-wxwidgets \
--with-cairo \
--with-opengl-libs=/usr/include/GL \
--with-motif \
--with-tcltk-includes="/us\\r/include/tcl8.5" \
--with-ffmpeg=yes --with-ffmpeg-includes="/usr/include/libavcodec /usr/include/libavformat /usr/include/libswscale /usr/include/libavutil" \
--with-freetype=yes --with-freetype-includes="/usr/include/freetype2/" --with-postgres=yes --with-postgres-includes="/usr/include/postgresql" \
--with-sqlite=yes \
--with-mysql=yes --with-mysql-includes="/usr/include/mysql" \
--with-odbc=no

The above commands can be downloaded here.
After ./configure ends successfully run:

$ make
$ make install

To run Grass (wich is not necessary, since it will be called directly from the nets) simply use this command grass64.

Set the variables

The path of the Grass installation should be specified as well as the sample data. Otherwise, Renew can neither call the Grass commands nor to display information about the images. Therefore, two variables need to be set in the plugin.cfg and more better in the .renew.properties at the home directory (or in config file in dist directory of Renew) as follows:

de.renew.renewgrass.gisbase=”PathToGrassRelease”.
de.renew.renewgrass.mapset=“PathTosample data”.

Problems?

If you encounter problems when compiling Grass GIS, plase take a look at the official documentation.