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.
Default locators cannot be removed using the Address Locator Manager; the Remove button in the dialog box is disabled when they are selected.
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.
- System default locators—These locators are available to every user of the ArcMap application. You can add or remove the system default locators from the list if you have administrative rights to access the DefaultLocators.xml file that is stored in the Locators folder under your ArcGIS installation directory, such as C:\Program Files\ArcGIS\Desktop10.1. (Note that there is also an XSD file with the same name in the same directory; the XSD file shouldn't be edited.)
- User default locators—These locators are available only to the user who starts the ArcMap application. An individual user can modify the DefaultLocators.xml file that is in the Locators folder under the user profile to specify user default locators. The file can be found in these locations:
- Windows XP—C:\Documents and Settings\[user]\Application Data\Esri\Desktop10.1\Locators
- Windows 7 or Vista—C:\users\[user]\AppData\Roaming\Esri\Desktop10.1\Locators
If you do not have administrative privileges to access the system DefaultLocators.xml file, editing the user DefaultLocators.xml still enables you to manage the list of default locators that you see.Tip:To navigate to the Application Data or AppData folder, you can type %appdata% in the Address text box of Windows Explorer and press ENTER.
Default locators can be a locator in a file folder, a geodatabase, or a geocode service published through ArcGIS for 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.
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:
|
<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 for 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.1\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.
-
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.
- 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.
- 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.
- Save the DefaultLocators.xml file.
- Start or restart ArcMap to see the new list of default locators on the Geocoding toolbar.
- 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:
- You do not have administrative privileges to access the system DefaultLocators.xml file, which is stored in the ArcGIS installation directory.
- You do not want to display or use any system default locators in ArcMap.
- You want to add your own locators or geocode services to the list of default locators in ArcMap.
- 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.1\Locators
- Windows 7 or Vista—C:\users\[user]\AppData\Roaming\Esri\Desktop10.1\Locators
- 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.
- 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.
- 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"
- Save the DefaultLocators.xml file.
- Start or restart ArcMap to see the new list of default locators on the Geocoding toolbar.