NOTICE: This package is not under active developent anymore, please refer to the FortranGIS project for a new and more complete Fortran interface to GIS libraries using ISO_C_BINDING facilities of Fortran 2003.
./configure make make installTry configure --help for more options to the configure script, for example for indicating a particular Fortran compiler. Make sure that the shapelib package (including the development package if you distribution has one) is installed and accessible before trying to build the Fortran bindings.
The package contains also a spec file so that you can quickly build a rpm package, on a GNU/Linux system supporting rpm, just issuing the command rpmbuild -ba <package-name>.tar.gz.
Shapelib-fortran has been tested on Fedora 12 and Debian lenny i386/x86_64 GNU/Linux systems. It has been successfully tested with gfortran, g95 and pgf90 Fortran compilers.
USE shplibto your program unit. The API has been kept as close as possible to the original C API; the retrieved shapes are stored in a Fortran derived type shpobject which mimics the C structure SHPObject. Notice that the shpopen function, unlike Fortran OPEN statement, requires the filename variable not to contain trailing blanks unless this is explicitly wanted as a part of the filename!, so the use of the Fortran intrinsinc function TRIM() is suggested in this case.
See shplib.f90 for the parameter and derived type definitions and shp_read_test.f90 and shp_write_test.f90 for an example.
Be warned that the Fortran bindings do not support the DBF attribute features of the C shapelib.