FortranGIS
Version2.5
|
Fortran 2003 interface to the shapelib http://shapelib.maptools.org/ library. More...
Data Types | |
interface | dbfreadattribute |
Interface to SUBROUTINEs for reading dbf attributes. More... | |
interface | dbfwriteattribute |
Interface to FUNCTIONs for setting dbf attributes. More... | |
type | shpfileobject |
Object describing a shapefile dataset. More... | |
type | shpobject |
Object describing the geometrical properties of a shape. More... | |
Functions/Subroutines | |
type(shpfileobject) function, public | shpopen (pszshapefile, pszaccess) |
It tries to open the files composing a shapefile dataset. More... | |
logical function, public | shpfileisnull (hshp) |
It returns .TRUE. More... | |
logical function, public | dbffileisnull (hshp) |
It returns .TRUE. More... | |
type(shpfileobject) function, public | shpcreate (pszshapefile, nshapetype) |
It creates a new, empty set of files composing a shapefile dataset. More... | |
subroutine, public | shpgetinfo (hshp, nentities, shapetype, minbound, maxbound, dbffieldcount, dbfrecordcount) |
It gets information about the shapefile database, including dbf. More... | |
type(shpobject) function, target, public | shpreadobject (hshp, ishape) |
It reads a single shape from a shapefile. More... | |
logical function, public | shpisnull (psobject) |
It returns .TRUE. More... | |
subroutine, public | shpclose (hshp) |
It closes all the files associated with the shapefile dataset. More... | |
type(shpobject) function, target, public | shpcreatesimpleobject (nshptype, nvertices, padfx, padfy, padfz) |
It creates a new shape object, simple version. More... | |
type(shpobject) function, target, public | shpcreateobject (nshptype, ishape, nparts, panpartstart, panparttype, nvertices, padfx, padfy, padfz, padfm) |
It creates a new shape object, full version. More... | |
subroutine, public | shpcomputeextents (psobject) |
It recomputes the extents of a shape. More... | |
integer function, public | shpwriteobject (hshp, ishape, psobject) |
It writes a shape object to a file. More... | |
subroutine, public | shpdestroyobject (psobject) |
It destroys a shape object for subsequent reuse or when not used anymore. More... | |
integer function, public | dbfgetfieldindex (hshp, pszfieldname) |
It returns the index of the field matching the name. More... | |
integer function, public | dbfgetfieldinfo (hshp, ifield, pszfieldname, pnwidth, pndecimals) |
It returns information about a dbf field. More... | |
integer function, public | dbfaddfield (hshp, pszfieldname, etype, nwidth, ndecimals) |
It adds a new field to an existing dataset. More... | |
logical function, public | dbfisattributenull (hshp, ishape, ifield) |
It returns .TRUE. More... | |
character(len=1) function, public | dbfgetnativefieldtype (hshp, ifield) |
It returns the dbf type code of the requested field. More... | |
Variables | |
integer, parameter, public | shpt_null = 0 |
Series of constants for specifying type of new shape datasets with shpcreate, null shape. More... | |
integer, parameter, public | shpt_point = 1 |
points More... | |
integer, parameter, public | shpt_arc = 3 |
arcs (Polylines, possible in parts) More... | |
integer, parameter, public | shpt_polygon = 5 |
polygons (possible in parts) More... | |
integer, parameter, public | shpt_multipoint = 8 |
multiPoint (related points) More... | |
integer, parameter, public | shpt_pointz = 11 |
3D (+ measure) points More... | |
integer, parameter, public | shpt_arcz = 13 |
3D (+ measure) arcs More... | |
integer, parameter, public | shpt_polygonz = 15 |
3D (+ measure) polygons More... | |
integer, parameter, public | shpt_multipointz = 18 |
3D (+ measure) multiPoint More... | |
integer, parameter, public | shpt_pointm = 21 |
2D + measure points More... | |
integer, parameter, public | shpt_arcm = 23 |
2D + measure arcs More... | |
integer, parameter, public | shpt_polygonm = 25 |
2D + measure polygons More... | |
integer, parameter, public | shpt_multipointm = 28 |
2D + measure multiPoint More... | |
integer, parameter, public | shpt_multipatch = 31 |
complex (TIN-like) with Z, and Measure More... | |
integer, parameter, public | ftstring = 0 |
Series of constants for specifying dbf field type, fixed length string field. More... | |
integer, parameter, public | ftinteger = 1 |
numeric field with no decimals More... | |
integer, parameter, public | ftdouble = 2 |
numeric field with decimals More... | |
integer, parameter, public | ftlogical = 3 |
LOGICAL field. More... | |
integer, parameter, public | ftinvalid = 4 |
not a recognised field TYPE More... | |
Fortran 2003 interface to the shapelib http://shapelib.maptools.org/ library.
This module defines an API which reflects the original shapelib C API with some modifications:
The module defines two derived types: shpfileobject associated to a shapefile dataset, and shpobject associated to a single shape within a dataset. Access to database (.dbf) information is done by accessing the file object only.
For an example of application of the shapelib module, please refer to the following test program, which creates a shapefile and successively reads it: