Maptitude GISDK Help

Find with Location Index

 

Summary

Finds an address using a Location index.

 

Syntax

result_array = RunMacro("GISDK Find With Location Index", integer index_handle, string address, integer default_street_number, string|int|array postal_codes, string city, string layer_name, integer get_zips_from_map, integer interactive)

 

Argument

Contents

index_handle

A handle for a Location index, returned by the Get Location Index macro

address

The address to find

default_street_number

A default street number to use if it is missing from address, or null to assign a street number by parsing it from address

postal_codes

An optional list of postal codes, which can be an integer, a string, or an array of string or integer values; if null or the wildcard string "*", search for any postal code

city

An optional city name

layer_name

The name of the layer corresponding to the geographic file used to create the index file

get_zips_from_map

If not null or 0 (the default), try to use the U.S. ZIP Codes contained in the current map window

interactive

If not null or 0 (the default), and there are multiple matching street segments, display the Please Choose A Matching Record dialog box so the user can choose the right one

 

Return Value

A 12 element array:

 

Element

Type

Contents

1

String

Null if address was found; otherwise, the error message "Not Found"

2

Coord

A coord compound variable, or null if element 1 is not null

3

String

The actual street name found

4

String

The actual postal code found

5

Integer

The ID of the matching street feature

6

Integer

The matching score, where:

0 = Address not found

1 = A perfect match

N+1 = A match with N errors

7

Integer

The parsed input street number

8-12

N/A

Reserved for future uses

 

Notes

Example

// 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"

layer_name = "Hartford Streets"

SetAlternateInterface("geocode")

index_properties = RunMacro("GISDK Get Location Index Properties",index_file)

index_handle = RunMacro("GISDK Get Location Index", index_file, layer_name,

index_properties, 25, "Feet") 

result_array = RunMacro("GISDK Find With Location Index", index_handle,

"1450 Asylum Ave", , "06105", , layer_name, , 1) 

ShowArray(result_array)

 

 

©2025 Caliper Corporation www.caliper.com