Using GeoStan

Get to know the concepts used by GeoStan

This chapter provides the following information on the concepts used by GeoStan.

Detailed below is an introduction to running GeoStan. See the following topics for more information:

Get and set functions

GeoStan provides a variety of functions to load and retrieve data from the internal data structures of GeoStan. The Set functions require a "Switch" and a "Value" argument. The "Switch" argument is a symbolic constant that identifies the data element to be stored. The "Value" argument is the actual data string to be stored. The Get functions require the same "Switch" arguments used by the Set function, a pointer to a buffer to be filled with the returned data, and an argument specifying the maximum length of data that GeoStan should return.

Basic use of GeoStan

The GeoStan functions all use a common internal data structure that is initialized with a call to GsInitWithProps. This function returns a GsId that is then passed to every other GeoStan function. Upon completion of the geocoding session, a call to GsTerm frees the memory allocated by GsInitWithProps and closes all files used by GeoStan.

Each GeoStan function returns either a status code or a pointer. There is a symbolic constant for every status code returned by a function. If the function returns a pointer, there is usually only one possible error that would be indicated by the return of NULL. Appendix D: Status codes overview details all possible status codes for each function.

Note: Calling GsInitWithProps with the appropriate DPV initialization properties set initializes DPV if you have installed the DPV data. Calling GsInitWithProps with the appropriate LACSLink properties set initializes LACSLink if you have installed the LACSLink data. We recommend that you initialize GeoStan with DPV and/or LACSLink at the same time with a single GsInitWithProps call. Otherwise, you can initialize either features after GeoStan is initialized by calling GsInitWithProps. DPV, SuiteLink, and LACSLink are optional when processing records in CASS mode. However, you must use DPV, SuiteLink, and LACSLink data for CASS certification.

Basic matching

Once GeoStan initializes, there are many options available through the GeoStan functions to allow diverse implementations of matching strategies. A basic approach is outlined below:

  1. Construct initialization properties.

  2. Initialize GeoStan using GsInitWithProps.

  3. Construct find properties.

  4. Load all components of an address using GsDataSet.

  5. Ask GeoStan to find the address by calling GsFindWithProps.

  6. Retrieve the match information by calling GsDataGet.

  7. Clear the Gs data buffer by calling GsClear.

  8. Repeat steps 2 through 5 for each address to be geocoded.

  9. Close GeoStan using GsTerm.

This approach does not include any "advanced" features such as query or match candidate resolution. In reality, however, the burden of development is mostly in creating the user interface; query or match candidate logic can be implemented quickly and easily.

Samples

Refer to the sample code provided in the installation directory as follows:

Windows:

\Geolib\Ms_c

UNIX:

<install directory>/samples

where <install directory> is the user-specified directory to which the tar file was extracted.

Optimization issues

Precisely designed and developed the GeoStan data format and functions to allow you to directly access from your internet download or DVD. However this design is most effective when you process records in State plus City order, or in ZIP Code order.