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

Prepares GSX files needed to cover the MBR.

Syntax

GsFunStat GsPrepareIndexMbr(GsId gs,long lon1,long lat1,long lon2,long lat2,const char *outDir, void *progressData, spatialQueryProgress progress);

Arguments

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

lon1   Minimum longitude. One of four values that make up the MBR. Input.

lat1  Minimum latitude. One of four values that make up the MBR. Input.

lon2   Maximum longitude. One of four values that make up the MBR. Input.

lat2   Maximum latitude. One of four values that make up the MBR. Input.

*outDir    Directory to write .gsx files.

*progressData   Data to pass to progress. Input.

progress   Callback function for progress meter. If NULL GeoStan does not call progress. Input.

Return Values

GS_SUCCESS

GS_ERROR

GS_CANCEL    Progress function received a cancel request from user.

Prerequisites

GsInitWithProps()

MBR Representation by Lat/Lon

See GsFindFirstSegmentByMbr for an MBR representation by latitude and longitude.

Notes

Prepares the reverse geocoding system for each Finance Area needed to cover the MBR specified by the four lat/lon parameters.

Call before GsFindFirstSegmentByMbr().

Note: This function expects that you have either installed the prebuilt GSX file that ships on the data media or that you have already created the GSX file using the batchind.exe utility included with GeoStan. For more information, refer to the GeoStan Geocoding Suite Utilities Manual.
For proper execution, initialize GeoStan with a call to GsInitWithProps and include at least the following properties set to TRUE:
  • GS_INIT_OPTIONS_ADDR_CODE
  • GS_INIT_OPTIONS_SPATIAL_QUERY
  • GS_INIT_OPTIONS_Z9_CODE

In addition, when using GsInitWithProps() include the outDir directory in the search path. For example, C:\data;C:\gsxout, where C:\data contains the primary data files and C:\gsxout is the output directory for .gsx files. Include finmbr.dat in the GsInitWithProps() search path when creating .gsx files.

Example

See GsFindFirstSegmentByMbr for an example.

Progress Function

You can use the progress function as a progress counter and to cancel spatial queries interactively. The progress function is defined in geostan.h as follows:

intl (*spatialQueryProgress)(void *param, intl mode, intl value);

*param   Points at the progressData argument passed to the GsPrepareIndexMbr() function.

mode   One of three values in the table below. Value contents vary depending on mode.

0

Initialize progress meter.value is estimated total number of steps.

Return GS_PROGRESS_CONTINUE or GS_PROGRESS_CANCEL.

1

value contains current step number.

Return GS_PROGRESS_CONTINUE or GS_PROGRESS_CANCEL.

2

Terminate progress meter.value is unused.

Return value ignored.