How To: Rename output address components in an existing address locator
This article describes how to modify the grammar in the *.loc.xml of an existing address locator to change the display name of the output candidate fields. These are the fields that display in the geocode result or candidate fields list of the REST endpoint of a geocode service.
The instructions below use an address locator based on the US Address - Single House Subaddress style, where the SubAddrType and SubAddrUnit components are displayed as UnitType and UnitNumber in the output fields. However, the concepts can be applied to locators based on other styles.
Warning: Make a copy of the *.loc.xml prior to modifying the file. Make sure to have write permissions to the folder where the address locator is stored.
Note: Notepad++ is an example of a text editor that can be used to modify the XML file.
- Open the *.loc.xml in a text or XML editor.
- Search for SingleAddressUnitSearch.
- Scroll down the list to <outputs>.
- Add name= as a property to the output tag for the SubAddrType and SubAddrUnit address components and surround the name with double quotation marks.
<output ref="SubAddrType" batch_mode="false" length="12"/> <output ref="SubAddrUnit" batch_mode="false" length="12"/>After:
<output name="UnitType" ref="SubAddrType" batch_mode="false" length="12"/> <output name="UnitNumber" ref="SubAddrUnit" batch_mode="false" length="12"/>
- Save the edits.
- Republish the address locator to ArcGIS Server.