PROJ

Overview

PROJ is a generic coordinate transformation software that transforms geospatial coordinates from one coordinate reference system (CRS) to another. This includes cartographic projections as well as geodetic transformations. PROJ includes command line applications for easy conversion of coordinates from text files or directly from user input. PROJ also exposes an application programming interface (API).

Restrictions on use

There are no restrictions on access to the PROJ libraries on CSF. The software is released under a MIT/X-like license. 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/proj/6.3.1
module load libs/gcc/proj/5.2.0

Datumgrid Data Files

In PROJ 6.3.1 the proj-datumgrid-1.8.zip (2018-09-15) file has been downloaded and unpacked in the installation area. The data directory is given by the environment variable $PROJ_LIB after loading the modulefile.

In PROJ 5.2.0 the default NAD datafiles are present in the install area. The data directory is given by the environment variable $PROJ_LIB after loading the modulefile.

Compiling an PROJ-capable application

You will mostly use the PROJ installation on CSF3 when compiling your own software. This allows you to add PROJ functionality to your own apps. There are some tools you can also run to process existing data files (see below).

The modulefiles will set an environment variable named ${PROJDIR} 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${PROJDIR}/include ....
  • To inform the compiler of the library files use:
    gcc ... -L${PROJDIR}/lib -lproj
  • In a Makefile ensure you use ${PROJDIR} rather than $PROJDIR.

An example compilation command could be

gcc -I${PROJDIR}/include example_proj.c -o example_proj -L${PROJDIR}/lib -lproj

Running an PROJ-capable application

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

Please do not run PROJ-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/proj/6.3.1

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

Submit the jobscript using:

qsub scriptname

where scriptname is the name of your jobscript.

PROJ Tools

The PROJ bin directory is added to your path so that you can access the proj... tools. Use ls ${PROJBIN} to see all binary tools:

# PROJ tools - must be used in batch jobs, as above
cct  cs2cs  geod  gie  invgeod  invproj  proj  projinfo

Further info

See the PROJ website for full documentation.

Updates

None.

Last modified on March 12, 2020 at 3:41 pm by George Leaver