GsCityFindFirst - 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

Finds the first city matching the partial name or valid ZIP Code.

Syntax

intlu GsCityFindFirst(GsId gs, gs_const_str State,gs_const_str cityPattern);

Arguments

GsIdgs   ID returned by GsInitWithProps() for the current instance of GeoStan. Input.

vgs_const_strState    Various state abbreviations and spellings, or blank for a ZIP Code search. For example, for New Hampshire, it accepts:N HAMP, N HAMPSHIRE, NEW HAMPSHIRE, NEWHAMPSHIRE, NH, and NHAMPSHIRE. Input.

gs_const_strcityPattern   City to search for (may be just a partial string), or a 3- or 5-digit ZIP Code. Input.

Return Values

Record number of the city located, or zero if GeoStan did not find any cities.

Prerequisites

GsClear()

Notes

This function retrieves the record number of the first city in a state that matches the city or ZIP Code search string. For example if the entered state string is CA and the city string is S, GeoStan finds the first city that begins with S in California. If the entered city string is 803 and the state string is null, GeoStan returns the first city in that sectional center. GeoStan does not return cities in any predefined order.

Before each find function, call GsClear() to reset the internal buffers. If you do not reset the buffers, you may receive incorrect results with information from a previous find.

Example

/* This example prints all city names in the 803 sectional center. */
                 
intlu CityRecNum;
char CityName[30];
                 
GsClear(gs);
CityRecNum = GsCityFindFirst( gs, "", "803" );
while (CityRecNum != 0 )
{
GsCityDataGet( gs, CityRecNum, GS_CITY_NAME, CityName,sizeof(CityName) );
printf( "%s\n", CityName );
GsClear(gs);
CityRecNum = GsCityFindNext( gs );
}