Setting default locators in ArcMap

Default locators are locators that are always available in ArcMap. You can choose the locator and use it to find addresses or locations right away from the Geocoding toolbar or the Find dialog box. The default locators are not saved in your map document, but every time you start ArcMap or open a map document, the default locators are added automatically.

The Geocoding toolbar and the Find dialog box include a few default locators, including the geocode services from ArcGIS Online and the MGRS (Military Grid Reference System) locator. You can choose any one of them to find addresses or locations.

Geocoding toolbar with default locators

Default locators cannot be removed using the Address Locator Manager; the Remove button in the dialog box is disabled when they are selected.

Address Locator Manager dialog box

Instead, default locators are managed in two XML files—both named DefaultLocators.xml, but stored in different folders. One file is for managing systemwide default locators; the other is for managing user-specific default locators.

Default locators can be a locator in a file folder, a geodatabase, or a geocode service published through ArcGIS Server. If the locator in the XML file is not valid due to various reasons such as a broken database or server connection, incorrect locator name, or errors in the locator, the invalid default locator will be skipped for the next one in the list.

Defining a default locator in DefaultLocators.xml

The DefaultLocators.xml file contains a list of default locators. The order of locators defined in the file determines how they are displayed in the list that appears from the Geocoding toolbar. The first locator on the list is initially set as the active locator for ArcMap.

You can use an XML editor, such as Microsoft Visual Studio, to edit the DefaultLocators.xml files. After you open the file in the XML editor, you see descriptions and examples that are enclosed in a comment tag pair (<!-- and -->). You can add your own comments to the file using these tags. (You can also comment out an existing default locator definition by adding the comment tags around it. This removes the locator from the list of default locators in subsequent sessions of ArcMap.)

In the XML editor, if you hover the mouse cursor over a tag, a ToolTip appears showing the description of the tag.

DefaultLocators.xml—Inline description
When you type a left angle bracket (<) after a tag, a pop-up menu appears and displays the choices of element you can use based on the context. You can press the DOWN ARROW key on the keyboard to select the tag.
DefaultLocators.xml—Elements

You can define a default locator by writing the appropriate information within XML syntax. If you're not familiar with XML, it would be helpful to learn the basics of XML elements, tags, and attributes. Although this topic doesn't cover these basics, understand that XML elements are enclosed by tags, and tags are enclosed by angle brackets. The closing tag always has a slash immediately after the opening bracket. The following example shows an element that specifies the display name of a locator as My Locator: <display_name>My Locator</display_name>.

The set of default locators that are available in ArcMap is defined by a <default_locators> element. Each locator in the set of default locators is specified by a <locator_ref> element. The following table lists common tags that you can use to configure default locators:

XML tag

Description

<name>

The actual name of the locator or geocode service.

<display_name>

The alias name for the default locator. It is the name that will be displayed in various ArcGIS geocoding tools or dialog boxes such as Address Locator Manager.

<workspace_properties>

The properties of the workspace that contains the address locator or geocode service.

<factory_progid>

ESRI workspace factory ProgID of the COM component. It can be one of the following:

  • esriDataSourcesFile.ShapefileWorkspaceFactory
  • esriDataSourcesGDB.FileGDBWorkspaceFactory
  • esriDataSourcesGDB.AccessWorkspaceFactory
  • esriDataSourcesGDB.SDEWorkspaceFactory
  • esriGISClient.AGSServerConnectionFactory

<path>

The path of the folder or file-based geodatabase that contains the address locator you want to use as a default locator.

<ags_connection_properties>

The ArcGIS Server connection properties of the geocode service that you want to use as a default locator.

<url>

The URL link to the geocode service. For example, it can be a URL pointing to http://tasks.arcgisonline.com/arcgis/services for the ArcGIS Online geocode service.

The following examples illustrate how to define default locators based on the type of workspace the locator is in:

Defining a locator in a file folder as a default locator

  
    <locator_ref>
      <name>My USA address locator</name>
      <display_name>USA address locator</display_name>
      <workspace_properties>
        <factory_progid>esriDataSourcesFile.ShapefileWorkspaceFactory</factory_progid>
        <path>E:\USA_locators</path>
      </workspace_properties>
    </locator_ref>

Defining a locator in a file or personal geodatabase as a default locator

  
    <locator_ref>
      <name>USA Streets address locator</name>
      <display_name>USA streets address locator</display_name>
      <workspace_properties>
        <factory_progid>esriDataSourcesGDB.FileGDBWorkspaceFactory</factory_progid>
        <path>D:\locators\MyAddressLocatorGDB.gdb</path>
      </workspace_properties>
    </locator_ref>

Defining a locator in an ArcSDE geodatabase as a default locator. You can either set the connection to the ArcSDE geodatabase using a path to the connection file or specify the connection properties.

   
    <locator_ref>
      <name>SDE.Atlanta</name>
      <display_name>Atlanta from SDE</display_name>
      <workspace_properties>
        <factory_progid>esriDataSourcesGDB.SDEWorkspaceFactory</factory_progid>
        <path>C:\Documents and Settings\[user]\Application Data\ESRI\Desktop10.0\ArcCatalog\[connection_file].sde</path>
     </workspace_properties>
    </locator_ref>

Defining a geocode service from a Web application or ArcGIS Online as a default locator

   
    <locator_ref>
      <name>Locators/TA_Address_NA</name>
      <display_name>North America Geocode Service (ArcGIS Online)</display_name>
      <workspace_properties>
        <factory_progid>esriGISClient.AGSServerConnectionFactory</factory_progid>
        <ags_connection_properties>
          <url>http://tasks.arcgisonline.com/arcgis/services</url>
        </ags_connection_properties>
      </workspace_properties>
    </locator_ref>

Editing system default locators

If you have shared locators available through network connections or geocode services in Web applications, you can configure them as system default locators on your organization's computers. Then anyone who uses ArcMap on those computers can easily access the shared locators.

Steps:
  1. Open the DefaultLocators.xml file in the Locators folder under your ArcGIS installation directory with an XML editor.

    You must have administrative privileges to access the file in your ArcGIS installation directory.

  2. Write a block of <locator_ref> code to add a locator or geocode service. (Examples are provided earlier in this topic.)

    The order of the locators in the XML file determines the order they are listed on the Geocoding toolbar. The first locator in the list is also automatically set as the active locator in ArcMap.

  3. To remove a default locator from the list, delete or comment out the block of <locator_ref> code that describes the locator you want to remove.
  4. Save the DefaultLocators.xml file.
  5. Start or restart ArcMap to see the new list of default locators on the Geocoding toolbar.
  6. Optionally, you can share your default locators with other users who use ArcGIS on other computers by copying the DefaultLocators.xml file to the Locators folder under their ArcGIS installation directory.

Editing user default locators

User default locators are available only to the user account that starts the ArcMap application. You may need to edit the user default locators file for the following reasons:

Steps:
  1. Open the user-specified DefaultLocators.xml file with an XML editor. The file can be found in the following folders:
    • Windows XP—C:\Documents and Settings\[user]\Application Data\ESRI\Desktop10.0\Locators
    • Windows 7 or Vista—C:\users\[user]\AppData\Roaming\ESRI\Desktop10.0\Locators
  2. Write a block of <locator_ref> code to add a locator or geocode service. (Examples are provided earlier in this topic.)

    When ArcMap is opened, the user default locators appear in the Geocoding toolbar above the system default locators.

  3. To remove a user default locator from the list, delete or comment out the block of <locator_ref> code that describes the locator you want to remove.
  4. If you do not want to display any system default locators in ArcMap for the current user account, change the append_system_locators attribute for the <default_locators> tag from "true" to "false".

    If the append_system_locators attribute is set to "false", as in the following example, the system default locators do not appear in ArcMap.

    <default_locators append_system_locators="false" 

  5. Save the DefaultLocators.xml file.
  6. Start or restart ArcMap to see the new list of default locators on the Geocoding toolbar.

Related Topics


8/18/2010