HOW TO

Add custom reference data fields to geocoding candidates

Last Published: April 25, 2020

Summary

** Internal Publish Only! This article may contain information that is not intended for external circulation. **

Occasionally, geocoding candidates need to include some custom reference data fields. These are in addition to the standard data fields which include X/Y, reference data ID, percent along, shape, and so on. It is possible to add custom fields by modifying corresponding match rules and locator properties, either *.loc or *.lot files.

Procedure

The following steps describe how to perform this customization on ArcSDE geocoding services. To customize client-side geocoding services, you don't need to use the sdelocator command to export and import the .loc or .lot file from ArcSDE.

  1. Use the sdelocator command to get the properties of the locator, and redirect the output to a file. For example, sample_locator.loc:

    Code:
    sdelocator -s myserver -i 5151 -u sde -p sde -o describe -n sample_locator > sample_locator.loc

  2. Make a copy of the *.mat files used by the locator.

    Check the value of FileMAT property in the locator properties file you created in step 1 to find out which *.mat file is used. If fields need to be added to street intersection candidates, check IntFileMAT property. Typical filenames are:

    Code:

    FileMAT = us_addr1.mat
    IntFileMAT = us_intsc1.mat


    Of course, it is possible to edit the original *.mat file, but then all locators will be affected. For our example, we'll copy us_addr1.mat to sample.mat.

    Note:
    For ArcSDE, *.mat files are stored under $SDEHOME\geocode. New *.mat files should also be placed under the same folder. For client-side geocoding services (ArcGIS) *.mat files are stored in the Geocode folder under the ArcGIS desktop install folder.

  3. Modify the sample_locator.loc file to update FileMAT and IntFileMAT properties, for instance:

    Code:

    FileMAT = sample.mat

  4. Suppose that sample.mat has the following contents:

    Code:

    .....
    VAR StreetType 79 6 X ; Suffix street type
    VAR SufDir 85 2 X ; Suffix direction
    VAR LeftZone 87 20 X ; Left zone
    VAR RightZone 107 20 X ; Right zone


    To add custom fields to the geocoding candidates, add lines to the sample.mat file as in the following:

    Code:

    ...
    VAR StreetType 79 6 X ; Suffix street type
    VAR SufDir 85 2 X ; Suffix direction
    VAR LeftZone 87 20 X ; Left zone
    VAR RightZone 107 20 X ; Right zone
    VAR CustomField1 127 18 X ; This is our new custom field #1
    VAR CustomField2 145 60 X ; This is our new custom field #2


    What do the numbers in the new lines mean? For CustomField1, 127 is the offset to the start of the field in the internal candidate buffer and is calculated as 107 + 20 (the starting position of the previous field plus the length of the previous field); 18 is the length of this field (whatever field length is desired). The same pattern applies to CustomField2 (145 = 127 + 18, 60 is the field length).

    Note:
    The match fields that have been added here will not affect the scoring process.

  5. Modify sample_locator.loc to update the reference table definition and the query definition. Add the following properties making certain they are placed together with other properties of the same category:

    Code:

    RD.Table1.Column = CustomField1,"Custom Field #1",N,FALSE
    RD.Table1.Column = CustomField2,"Custom Field #2",N,FALSE

    RD.Query1.MF = CustomField1,Table1.CustomField1
    RD.Query1.MF = CustomField2,Table1.CustomField2

    RD.Val.Table1.CustomField1 = <name of the actual custom field #1>
    RD.Val.Table1.CustomField2 = <name of the actual custom field #2>



    Note:
    When adding fields to intersection candidates, modify RD.ILQuery.MF and RD.IRQuery.MF properties instead of RD.Query1.

  6. Delete the original locator and create the new locator in its place. For example:

    Code:

    sdelocator -s myserver -i 5151 -u sde -p sde -o delete -n sample_locator
    sdelocator -s myserver -i 5151 -u sde -p sde -o create -f sample_locator.loc

Article ID:000005559

Software:
  • ArcMap 8 x
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic