User Tools

Site Tools


TGIS_AddressMatching class

DK11 for Java | tatukgis.jdk.TGIS_AddressMatching | Classes | Constructors | Methods | Properties

Class supports address matching according to defined formulas.

Available also on: Delphi | .NET | ActiveX | Python.


// Java
public class TGIS_AddressMatching extends TGIS_BaseObjectDisposable {
// Oxygene
  TGIS_AddressMatching = public class( TGIS_BaseObjectDisposable )


→ TGIS_BaseObjectDisposable


Inherited Overrides Protected
Name Visibility Description
TGIS_AddressMatching() public Constructs instance, initializes internal data.


Inherited Overrides Protected
Name Visibility Description
Match public Matches given address string and address formulas.


Inherited Protected
Name Visibility Description
FormulasString public Field for formulas string.


Definition of the address formulas has the form of INI file contents. It can be received both from TIniFile- and TMemIniFile object, because it is required to provide the definition as a single string in format analogous to the Text property of TStrings class.

The formulas have to be stored within a section called '[FORMULA]'. Key names for values have no matter.

Address formula is a list of field definitions that can be mixed with additional text (see below for more directions). A field definition takes the form:


where the field name is defined in a section called the same name.

A field section contains a key called 'Format' with a regular expression value which defines the field.

There is one important limitation for the format syntax. Subexpressions of regular expressions can not be used, because they are used to retrieve field values.

If the field format is defined as an alternative of values, it is possible to define additional synonyms for values. They are listed in the field section in the form:


The synonyms support for example street type fields with lots of abbreviations. Combining an address formula with corresponding field formats and synonyms a format of final address formula is created and it becomes a regular expression for the formula.

Additional text can be mixed with field definitions in an address formula. Leading and trailing white characters are removed from the formula. A group of white characters is converted to one space character. A single white character is converted to a space characters.

Implicitly only characters from the following set can occur in words(\w):

[ 1234567890abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ]

The set can be redefined by using a special section named WORDCHARS in form of:


This is an example INI file with two address formulas.


Format=\w[\w\. ]+


;Main St
;address='N Adams St.,'
2=address='\<DIRPREFIX\>.? \<STREETNAME\> \<STREETTYPE\>.?,?'

In the example there are two fields in the first address formula: STREETNAME' and 'STREETTYPE'. Both the fields have their sections with a detailed description.

The field 'STREETTYPE' has synonyms defined for each possible value. The final format for the first formula takes the form:

^(\w[\w\. ]+)\s+(St|Ave|Blvd|Street|Avenue|Boulevard)$

and for the second formula:

^address='(N|S|E|W|NE|NW|SE|SW|EX)\s+(\w[\w\. ]+)\s+(St|Ave|Blvd|Street|Avenue|Boulevard).?,?'$

2022/11/16 01:39

Page Tools