DK11 for ActiveX | TatukGIS_XDK11.TGIS_AddressMatching | Classes | Methods | Properties
Class supports address matching according to defined formulas.
// C# public class TGIS_AddressMatching : ITGIS_AddressMatching { }
' VisualBasic Public Class TGIS_AddressMatching Implements ITGIS_AddressMatching End Class
// Oxygene type TGIS_AddressMatching = public class end;
Name | Visibility | Description | |
---|---|---|---|
AttachDelphiObj | public | Only for internal use of TatukGIS. (Inherited from ITBaseObject) |
|
DelphiObj | public | Only for internal use of TatukGIS. (Inherited from ITBaseObject) |
|
Match | public | Matches given address string and address formulas. | |
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:
<fieldname>
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:
<synonym>=<defined_value>
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:
[WORDCHARS] Format='string_which_contains_all_excpected_characters'
This is an example INI file with two address formulas.
[STREETTYPE] Format=St|Ave|Blvd Street=St Avenue=Ave Boulevard=Blvd [STREETNAME] Format=\w[\w\. ]+ [DIRECTIONTYPE] Format=N|S|E|W|NE|NW|SE|SW|EX [FORMULA] ;Main St 1=\<STREETNAME\> \<STREETTYPE\> ;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).?,?'$