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. Status codes details all possible status codes for each function.
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:
-
Construct initialization properties.
-
Initialize GeoStan using GsInitWithProps.
-
Construct find properties.
-
Load all components of an address using GsDataSet.
-
Ask GeoStan to find the address by calling GsFindWithProps.
-
Retrieve the match information by calling GsDataGet.
-
Clear the Gs data buffer by calling GsClear.
-
Repeat steps 2 through 5 for each address to be geocoded.
-
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.