Maptitude GISDK Help |
Loads a Location index into memory, if necessary, and gets a handle to the index.
index_handle = RunMacro("GISDK Get Location Index", string index_file, string layer_name, array index_properties, real offset, string offset_units)
Argument |
Contents |
index_file |
The name of the Location index file |
layer_name |
The name of the layer corresponding to the geographic file used to create the Location index file |
index_properties |
The Location index file property array, as returned by the Get Location Index Properties macro |
offset |
Default offset distance from street |
offset_units |
The name of the offset distance units (plural), such as Feet or Meters |
An index handle (a positive integer). If the program fails to load the Location index in memory, index_handle will be 0. If the program succeeds, index_handle will be a number greater than or equal to 1.
In Caliper Script, you must set the Geocode UI to be the alternate interface by calling SetAlternateInterface("geocode") before running this macro. When calling these macros from VBScript, add "geocode" after the macro name and before the first argument.
The index_file argument must either be a full pathname (e.g., "c:\\data\\myindex.idx") or a pathname relative to the Maptitude program folder (e.g., "myfiles\\myindex.idx")
The geocoding layer can be a point, line or area layer. It must be present in the workspace or in a map for this macro to succeed.
When locating addresses using a line layer, offset will be the distance from the street for the located address. If you want the point to be located on the street segment, set offset to 0.
Set offset to 0 for point or area layers.
// Before running this example, open a map with HARTFORD.CDF and make sure that
// the Location index HARTFORD.IDX exists, both in the Tutorial folder.
folder = RunMacro("G30 Tutorial Folder")
index_file = folder + "hartford.idx"
SetAlternateInterface("geocode")
index_properties = RunMacro("GISDK Get Location Index Properties",index_file)
index_handle = RunMacro("GISDK Get Location Index", index_file,
"Hartford Streets", index_properties, 25, "Feet")
ShowMessage("The Location index handle is " + I2S(index_handle))
©2025 Caliper Corporation | www.caliper.com |