Create Address Locator (Geocoding)

License Level:BasicStandardAdvanced

Summary

Creates an address locator. The address locator can be used to find a location of an address, geocode a table of addresses, or get the address of a point location.

Learn more about common geocoding tasks

Usage

Syntax

CreateAddressLocator_geocoding (in_address_locator_style, in_reference_data, in_field_map, out_address_locator, {config_keyword})
ParameterExplanationData Type
in_address_locator_style

The address locator style on which to base the new address locator.

Address Locator Style
in_reference_data
[[Reference Data, {Role}],...]

The reference data feature classes and tables to be used by the address locator, along with their roles.

  • Primary table—Defines the primary reference dataset feature class for a locator, such as a street centerline feature class. This is a required table.
  • Alternate Name table—Defines an alternate street name table that contains alternate names for the street or point features. The table is required to have a JoinID that can be used to join to the primary table. This table is optional.
  • Alias table—Defines a place name alias table that contains place names and actual addresses for the names. User can find the location using either the place name such as Field Museum or the address 1400 S Lakeshore Drive Chicago, IL 60605. This table is optional.

Custom locator styles or locator styles provided by third parties may define a different set of roles for reference datasets.

Value Table
in_field_map

The mapping of reference data fields used by the address locator style to fields in the reference datasets. Each field mapping in this parameter is in the format:

# <locator field alias> <dataset field name> VISIBLE NONE

# This shows as an example:
reference_data_field_map = """
"'Feature ID' FeatureID VISIBLE NONE;'*From Left' L_F_ADD VISIBLE NONE;
'*To Left' L_T_ADD VISIBLE NONE;'*From Right' R_F_ADD VISIBLE NONE;
'*To Right' R_T_ADD VISIBLE NONE;'Prefix Direction' PREFIX VISIBLE NONE;
'Prefix Type' PRE_TYPE VISIBLE NONE;'*Street Name' NAME VISIBLE NONE;
'Suffix Type' TYPE VISIBLE NONE;'Suffix Direction' SUFFIX VISIBLE NONE"""

where <locator field alias> is the alias name for the reference data field used by the address locator, and <dataset field name> is the name of the field in the reference dataset. Fields with an asterisk ("*") next to their names are required by the address locator style.

VISIBLE—Field is visible; NONE—the geometry is a copy of the original value.

If you choose not to map an optional reference data field used by the address locator style to a field in a reference dataset, specify that there is no mapping by using "<None>" in place of a field name.

To determine the alias name for a reference data field used by a locator style, open the Create Address Locator tool and choose the locator style. The name that appears in the Field Name column of the Field Map control is the field's alias name.

Field Info
out_address_locator

The address locator to create.

Address Locator
config_keyword
(Optional)

The configuration keyword that determines the storage parameters of the table in a Relational Database Management System (RDBMS)—ArcSDE and file geodatabases only.

String

Code Sample

CreateAddressLocator Example (Python Window)

The following Python window script demonstrates how to use the CreateAddressLocator function in immediate mode.

#   Create a street address locator using a street centerline feature class 
#   in a file geodatabase as reference data.
#   The new address locator will be created in the same file geodatabase.

# Import system modules
import arcpy
from arcpy import env
env.workspace = "C:/ArcTutor/Geocoding/atlanta.gdb"

arcpy.CreateAddressLocator_geocoding("US Address - Dual Ranges", "streets Primary", "'Feature ID' FeatureID VISIBLE NONE;'*From Left' L_F_ADD VISIBLE NONE;'*To Left' L_T_ADD VISIBLE NONE;'*From Right' R_F_ADD VISIBLE NONE;'*To Right' R_T_ADD VISIBLE NONE;'Prefix Direction' PREFIX VISIBLE NONE;'Prefix Type' PRE_TYPE VISIBLE NONE;'*Street Name' NAME VISIBLE NONE;'Suffix Type' TYPE VISIBLE NONE;'Suffix Direction' SUFFIX VISIBLE NONE;'Left City or Place' CITYL VISIBLE NONE;'Right City or Place' CITYR VISIBLE NONE;'Left Zipcode' ZIPL VISIBLE NONE;'Right Zipcode' ZIPR VISIBLE NONE;'Left State' State_Abbr VISIBLE NONE;'Right State' State_Abbr VISIBLE NONE", Atlanta_AddressLocator, "")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
1/22/2013