Finds the nearest point or line to a given point.
Syntax
intl gdlFindNearest( gdlFileHandle hFile, gdlShape input, gdlShape* output, intl type, intl max );
Arguments
hFile
The gdlFileHandle returned by gdlOpenSpatialFile. Input.
input
The gdlShape object that contains the input point. Input. output A pointer to the nearest gdlShape object. Output.
type
The type of shape to find. Input.
Type options:
GDL Shape Types |
---|
GDL_POINT |
GDL_LINE |
max
The maximum to search in feet. Input.
Return values
GDL_WRONG_TYPE
GDL_NOT_FOUND
GDL_ERROR
GDL_OK
Prerequisites
gdlOpenSpatialFile
gdlShapeCreate or gdlGenerateErrorSurface
Alternates
None.
Notes
Features are returned from nearest to farthest.
Following instances of this function, you should call gdlShapeFree with the output shape when you are finished using the output shape to release system resources.
The following diagram illustrates the nearest point and nearest line to a given point: