GEOS

Overview

GEOS (Geometry Engine, Open Source) is a C++ port of the ​JTS Topology Suite (JTS). It aims to contain the complete functionality of JTS in C++. This includes all the ​OpenGIS Simple Features for SQL spatial predicate functions and spatial operators, as well as specific JTS enhanced functions. GEOS provides spatial functionality to many other projects and products.

Restrictions on use

There are no restrictions on access to the GEOS libraries on CSF. The software is released under the GNU Lesser General Public License (LGPL). All usage must adhere to this license.

Set up procedure

We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job inherit these settings.

Load one of the following modulefiles to set up your environment:

module load libs/gcc/geos/3.8.0               # Uses system default GCC 4.8.5 compiler

Compiling an GEOS-capable application

You will mostly use the GEOS installation on CSF3 when compiling your own software. This allows you to add GEOS functionality to your own apps.

The modulefiles will set an environment variable named ${GEOSDIR} which can then be used in your compilation process (e.g., in a Makefile or directly on the command-line) to access the header and library files:

  • To inform the compiler of the header file directory use:
    gcc -I${GEOSDIR}/include ....
  • To inform the compiler of the library files use:
    gcc ... -L${GEOSDIR}/lib -lgeos
  • In a Makefile ensure you use ${GEOSDIR} rather than $GEOSDIR.
  • The geos-config application will be added to your PATH environment variable – some applications may run this to determine where the GEOS files are installed.

An example compilation command could be

gcc -I${GEOSDIR}/include example_geos.c -o example_geos -L${GEOSDIR}/lib -lgeos

Running an GEOS-capable application

You must load the GEOS modulefile before running your GEOS-capable application (unless you have statically linked your code against the GEOS libraries).

Please do not run GEOS-capable applications on the login node. Jobs should be submitted to the compute nodes via batch.

Serial batch job submission

Create a batch submission script (which will load the modulefile in the jobscript), for example:

#!/bin/bash --login
#$ -cwd             # Job will run from the current directory
                    # NO -V line - we load modulefiles in the jobscript

# Load the serial (non-MPI) modulefile
module load libs/gcc/geos/3.8.0

# Run my application I compiled earlier
./mygeosapp arg1 ...

Submit the jobscript using:

qsub scriptname

where scriptname is the name of your jobscript.

Further info

See the GEOS website for full documentation.

Updates

None.

Last modified on March 11, 2020 at 12:04 pm by George Leaver