GsHandleGetCoordsEx - geostan_1 - 2024.01

GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS

Product type
Software
Portfolio
Locate
Product family
GeoStan Geocoding Suite
Product
GeoStan Geocoding Suite > GeoStan
Version
2024.01
Language
English
Product name
GeoStan
Title
GeoStan Geocoding Suite Reference for Windows, Linux, and z/OS
Copyright
2024
First publish date
1994
Last updated
2024-07-29
Published on
2024-07-29T23:01:18.924000

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]);