This document is archived and information here might be outdated.  Recommended version.


How to rebuild an address locator (ArcObjects .NET 10.4 SDK)

How to rebuild an address locator


Summary
This topic shows how to rebuild an address locator for various scenarios.

In this topic


Determining when to rebuild address locators

Rebuild an address locator only if the reference data has been updated and the changes need to be added to the current address locator. See the following:
  1. Create a locator if you update a locator style. Rebuilding will not update the style associated with the current locator.
  2. Republish the locator after it is rebuilt, if you have a locator published to ArcGIS for Server.

Rebuilding an address locator

See the following code example to rebuild an address locator:
[C#]
public void RebuildAddressLocatorPersonalGeodataase()
{
    Geoprocessor GP=new Geoprocessor();
    RebuildAddressLocator rebuild=new RebuildAddressLocator();

    // Quotes are needed around the path to the address locator when it contains spaces.
    rebuild.in_address_locator=@"D:\Workspace\Madison\Madison.mdb\Madison Streets";
    GP.Execute(rebuild, null);
}
[VB.NET]
Public Sub RebuildAddressLocatorPersonalGeodataase()
    
    Dim GP As Geoprocessor=New Geoprocessor()
    Dim rebuild As RebuildAddressLocator=New RebuildAddressLocator()
    
    ' Quotes are needed around the path to the address locator when it contains spaces.
    rebuild.in_address_locator="D:\Workspace\Madison\Madison.mdb\Madison Streets"
    GP.Execute(rebuild, Nothing)
    
End Sub






To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):

Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced