Retrieves the coordinates for a street segment object found via GsFindFirst() and GsFindNext().
Syntax
ints GsHandleGetCoordsEx(GsId gs, GsSegmentHandle
*pHandle, pintl pCoords, intsu
maxPoints);
Arguments
gs ID returned by GsInitWithProps() for the current instance of GeoStan. Input.
*pHandle Handle of the segment object for the coordinates returned. Input.
pCoords Array of coordinates, in x,y (longitude, latitude) order. Output.
maxPoints Maximum number of points that GsGetCoordsEx() returns; used to prevent writing past the end of pCoords buffer. Input.
Return Values
Number of points assigned to the buffer.
Prerequisites
GsFindFirst() or GsFindNext()
Notes
This function returns an array of coordinates for the segment to which handle points.
GeoStan can return a maximum of 64 coordinate pairs, each pair consisting of two long integers.
Pass in a value of 2 for the maxPoints parameter to return the end points of the segment matched.
Example
/*This example retrieves coordinates for a street segment found using GsFindFirstSegment.*/
#define MAX_POINTS 50
.
.
.
ints NumCoords;
intl Coords[MAX_POINTS *2];
NumCoords = GsHandleGetCoordsEx(gs, &hSegment, Coords, MAX_POINTS);
for (int i = 0; i < NumCoords * 2; i += 2)
printf("Lon = %ld, Lat = %ld\n", Coords[i], Coords[i+1]);