Initializes GeoStan using properties.
Syntax
GsId GsInitWithProps(PropList*
pInitProps, PropList* pStatusProps);
Arguments
PropList*pInitProps* Pointer to property list structure of type GS_INIT_PROP_LIST_TYPE. Input.
PropList*pStatusProps Pointer to property list structure of type GS_STATUS_PROP_LIST_TYPE. Output.
Return Values
Returns the ID of the GeoStan instance that was initialized.
Prerequisites
GsPropListCreate()andGsPropSet*()
Notes
Initializes GeoStan using the property list. The application owns the property lists. The status property list is guaranteed to contain properties for all defined status properties with their values properly set.
GsInitWithProps can be used to initialize GeoStan, DPV, and LACSLink with a single call (if the appropriate initialization properties are in the init list). When this function successfully completes, it populates the GS_INIT_GS_ID property in the property list referred to by the pInitProps parameter with the actual GeoStan ID.
If you invoke this function with the GeoStan ID property pre-set to a valid GeoStan ID, it will not attempt to re-initialize GeoStan. This is how GsInitWithProps() can be used to initialize DPV and/or LACSLink after GeoStan has already been initialized with a previous call to GsInitWithProps(). If you intend to reuse the same initialization property list to initialize GeoStan several times you must reset the GS_INIT_GS_ID property back to zero, or completely remove the property from the list. This informs GeoStan that you want a new GeoStan instance when you call GsInitWithProps().
These initialization properties are required for GsInitWithProps to function correctly:
-
GS_INIT_LICFILENAME
-
GS_INIT_DATAPATH
-
GS_INIT_PASSWORD
These initialization properties are recommended, but not required:
-
GS_INIT_Z4FILE (required for ZIP centroid matching)
-
GS_INIT_OPTIONS_Z9_CODE (required for ZIP centroid matching)
-
GS_INIT_CACHESIZE (to improve GeoStan performance)
-
GS_INIT_OPTIONS_ADDR_CODE (required for address matching)
-
GS_INIT_OPTIONS_SPATIAL_QUERY (required for reverse geocoding and the MBR-related functions)
All other available initialization properties are entirely optional. See tables GsInitWithProps properties.
Example
GsFunStat retval;
PropList initProps;
PropList statusProps;
GsPropListCreate( &initProps, GS_INIT_PROP_LIST_TYPE);
GsPropListCreate( &statusProps, GS_STATUS_PROP_LIST_TYPE);
GsPropSetStr( &initProps, GS_INIT_LICFILENAME, "c:\\test\\Data\\my.lic");
GsPropSetStr(&initProps, GS_INIT_DATAPATH, "c:\\test\\Data" );
GsPropSetStr(&initProps, GS_INIT_Z4FILE, ""c:\\test\\Data\\us.z9" );
GsPropSetLong(&initProps, GS_INIT_PASSWORD, 12345678 );
GsPropSetLong(&initProps, GS_INIT_GSVERSION, GS_GEOSTAN_VERSION );
GsPropSetBool(&initProps, GS_INIT_OPTIONS_ADDR_CODE, TRUE );
GsPropSetBool(&initProps, GS_INIT_OPTIONS_Z9_CODE, TRUE );
GsPropSetBool(&initProps, GS_INIT_OPTIONS_SPATIAL_QUERY, TRUE );
GsPropSetLong(&initProps, GS_INIT_CACHESIZE, 0 );
GsPropSetLong(&initProps, GS_INIT_FILE_MEMORY_LIMIT, 4000 );
GsPropSetLong(&initProps, GS_INIT_GEOSTAN_ID, 0 ); // not required, but demonstrates the usage.
gs = GsInitWithProps(&initProps, &statusProps);