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

Returns the address elements for the match candidate specified.

Syntax

GsFunStat GsMultipleGet(GsId gs, GsEnum fSwitch, ints index,pstr pBuffer, intsu bufLen);

Arguments

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

Note: For a list of valid GsEnums and their sizes, see Enums for storing and retrieving data.

GsEnumfSwitch   Enum for the argument you want to retrieve. Input.

intsindex   Entry number (0-based) of the possible match. Input.

pstrpBuffer   Location for the returned data. Output.

intsubufLen   Maximum size of data for GeoStan to return. If bufLen is shorter than the data returned by GeoStan, GeoStan truncates the data and does not generate an error. Input.

Return Values

GS_SUCCESS

GS_ERROR

Prerequisites

GsNumMultiple()

Notes

This function retrieves data from the GeoStan buffer for match candidates. GeoStan indicates a match candidate as the GS_ADDRESS_NOT_RESOLVED return code for GsFindWithProps.() It is important to first test for an intersection match, since the enums are different for retrieving intersection and non-intersection matches.

When using any street name enum (GS_NAME, GS_PREDIR, GS_POSTDIR, GS_TYPE), an additional modifier is available. You can use GS_ALIAS to request specific alias information, rather than preferred name information. For example in Boulder, CO, Wallstreet is an alias for Fourmile Canyon. 123 Wallstreet, Boulder CO 80301, matches to 123 Fourmile Canyon Dr.

GsMultipleGet( ..., GS_NAME,... ) returns "FOURMILE CANYON". GsMultipleGet( ...,GS_ALIAS | GS_NAME,... ) returns "WALLSTREET".

If you use GS_ALIAS with an enum that does not return alias information (such as GS_ZIP), GeoStan returns the information in the normal format. If GS_IS_ALIAS returns A07, you can only get information based on the returned address, not the alias.

Note: GsMultipleGet() index zero output is different from the GsDataGet().

When using GsDataGet(), returned results may be altered for the best match based on all the candidates found. GsMultipleGet() however does not change the results but provides raw data for the returned candidates. Therefore, some enums may differ from GsMultipleGet() and GsDataGet(). For example, GS_ADDRLINE, only contains information available from the candidate data records. If there is no unit low-high on the candidate, no unit information is added to the GS_ADDRLINE.

The following enums are different if the GsDataGet() spatial information is inferred against another candidate in the list:
  • GS_LAT
  • GS_LON
  • GS_LOC_CODE
These enums differ when CASS logic decides the city/ ZIP/ ZIP+4 on the GsDataGet() lastline versus pure candidate information used for GsMultipleGet():
  • GS_CITY
  • GS_CITY_SHORT
  • GS_LASTLINE
  • GS_MM_RESULT_CODE
  • GS_MATCH_CODE
  • GS_NAME_CITY
  • GS_URB_NAME
  • GS_ZIP
  • GS_ZIP_CARRTSORT
  • GS_ZIP_CITYDELV
  • GS_ZIP_CLASS
  • GS_ZIP_FACILITY
  • GS_ZIP_UNIQUE
  • GS_ZIP4
  • GS_ZIP9
  • GS_ZIP10
These enums differ when information from the input carries over on the GsDataGet() versus pure candidate information used for GsMultipleGet():
  • GS_ADDRLINE
  • GS_FIRM_NAME
  • GS_HOUSE_NUMBER
  • GS_UNIT_NUMBER
  • GS_UNIT_TYPE

Example

/* This example prints information about possible matches. It assumes that GsFindWithProps 
   returned GS_ADDRESS_NOT_RESOLVED. */
             
char buffer[60];
int bInter;
             
printf( "Possibles:\n" );
/* Test for match candidate and set bInter to non-zero if true. */
GsMultipleGet( gs, GS_INTERSECTION, 0, buffer,sizeof(buffer) );
bInter = *buffer == 'T';
/* Get the number of multiples and print them as we loop through each one. */
int n = GsNumMultiple( gs );
for ( int i = 0; i < n; ++i )
  { 
  printf( "%d: ", i );
/* If we don't have an intersection, print the ranges. */
  if ( !bInter )
    {
   GsMultipleGet( gs, GS_LORANGE, i, buffer, sizeof(buffer) );
    printf( "%s ", buffer );
   GsMultipleGet( gs, GS_HIRANGE, i, buffer, sizeof(buffer) );
    printf( "%s ", buffer );
    }
/* Print the street name for both intersections and non intersections.*/
 GsMultipleGet( gs, GS_PREDIR, i, buffer, sizeof(buffer) );
  printf( "%s ", buffer );
 GsMultipleGet( gs, GS_NAME, i, buffer, sizeof(buffer) );
  printf( "%s ", buffer );
 GsMultipleGet( gs, GS_TYPE, i, buffer, sizeof(buffer) );
  printf( "%s ", buffer );
 GsMultipleGet( gs, GS_POSTDIR, i, buffer, sizeof(buffer) );
  printf( "%s ", buffer );
/* If an intersection match, print the second street name. */
  if ( bInter )
    {
    printf( " AT " );
   GsMultipleGet( gs, GS_PREDIR2, i, buffer, sizeof(buffer) );
    printf( "%s ", buffer );
   GsMultipleGet( gs, GS_NAME2, i, buffer, sizeof(buffer) );
    printf( "%s ", buffer );
   GsMultipleGet( gs, GS_TYPE2, i, buffer, sizeof(buffer) );
    printf("%s", buffer );
   GsMultipleGet( gs, GS_POSTDIR2, i, buffer, sizeof(buffer) );
    printf( "%s ", buffer );
    }
/* Print each possible on a new line. */
  printf( "(%s)\n", buffer );
}