GDL functions use three internal data structures: gdlHandle, gdlFileHandle and gdlShape. Whenever you make a function call that results in one of these data structures being returned as an output parameter, you must call a corresponding function to free the resources associated with the data structure.
To initialize the library, call the gdlInitialize function. This function initializes and returns a gdlHandle. When you are using gdlHandle, call gdlTerminate to release resources associated with it.
To open a spatial file, call the gdlOpenSpatialFile function. This function initializes a gdlFileHandle. When you are done using gdlFileHandle, call gdlCloseSpatialFile to release resources associated with the gdlFileHandle.
The following functions initialize a gdlShape object:
gdlGenerateErrorSurface
gdlGetStreetLength
gdlFindNearest
gdlFindNext
gdlFindPolygonOverlap
gdlFindNextPolygonOverlap
gdlFindPolygonOverlapPercentage
gdlFindNextPolygonOverlapPercentage
gdlPointInPolygon
gdlPointInPolygonNext
gdlShapeCreate
After calling one of the previous functions, you must call gdlShapeFree
to
release resources associated with the gdlShape object.
Program Flow
GDL applications normally follow the program flow listed below:
- Initialize the GDL library using gdlInitialize.
- Set properties necessary for generating error surfaces with the gdlSetStr function.
- Initialize the GeoStan™ library and call GsFind in order to geocode an address.
- Generate an error surface by passing the GeoStan handle that contains a valid match to the gdlGenerateErrorSurface function.
- Open a spatial file to make comparisons with using the gdlOpenSpatialFile function.
- Retrieve features from the spatial file for comparison.
- If you are looking for points or lines, use gdlFindNearest with gdlFindNext.
If you want to make comparisons with polygons, use gdlFindPolygonOverlap with gdlFindNextPolygonOverlap to determine if polygons overlap
OR
use gdlFindPolygonOverlapPercentage with gdlFindNextPolygonOverlapPercentage to determine percent overlap information.
- Release resources associated with the shapes you have received using the gdlShapeFree function.
- Close the spatial file by calling the gdlCloseSpatialFile function.
- Release resources associated with the GeoStan handle using GsTerm.
- Release resources associated with the gdlHandle by calling the gdlTerminatefunction.
Include Files for C Development
The C header file gdlapi.h contains all symbolic constants used or returned by the GDL functions, and should be included in every project.
Include Files for Visual Basic Development
The Visual Basic module gdlapi.bas contains the Visual Basic interface for the GDL functions. Geostan.inc contains all of the necessary constant definitions for GeoStan functions for use in Visual Basic development. Both files should be included in every project.
Include Files for COBOL Development on z/OS Systems
The COBOL copybook, GDLCOPY, contains the constants used or returned by the GDL procedures, and should be included in every project.
Samples
Refer to the sample code provided in the installation directory as follows:
\GDL\MS_c
\GDL\Vbasic