Add Polygon Fields To Locator (Geocoding)

Summary

Adds custom output fields from a polygon layer to an existing locator stored locally.

Usage

  • This tool can add up to 50 unique fields from a polygon feature class to a locally stored ArcGIS StreetMap Premium locator or locators built with the Create Locator tool or Create Feature Locator tool.

  • An ArcGIS StreetMap Premium license is required to add fields from a polygon layer to ArcGIS StreetMap Premium locators.

  • If you have multiple polygon feature classes that contain fields to add to the locator, use the Union tool or Merge tool depending on the data to combine the polygon feature classes into a single polygon feature class and use that as the Polygon Features parameter value from which to add fields.

  • When the Polygon Features parameter value has a selection, the tool will ignore the selection.

Parameters

LabelExplanationData Type
Input Locator

The locator (.loc file) where the fields will be added.

Note:

The locator cannot be a composite locator or a geocode service, including services from ArcGIS Enterprise or ArcGIS Online. You must add the polygon fields to the participating locators of a composite locator before publishing the locator as a geocode service.

Address Locator
Polygon Features

The feature class containing the fields that will be added to the Input Locator parameter value (fields will be appended to all geocoding output).

Feature Layer
Polygon Output Field(s)

The fields from the polygon feature class that will be appended to the locator.

Select the field from the Polygon Field(s) drop-down list, and the field name from the polygon features will be used as the default field name. The default field name is automatically added to the Name column. The default field name can be overwritten. The specified fields or Name values provided for this parameter will define the names of the output fields from the Polygon Features parameter value that will be returned in the geocode result. If the fields from the polygon features have aliases, the field alias will be used as the Name value.

  • Polygon Field(s)—The fields from the Polygon Features parameter value that will be added to the locator.
  • Name—The name of the custom output field that will appear in the geocode results and locator properties.
Value Table

Derived Output

LabelExplanationData Type
Updated Locator

The updated input locator with the output fields from the polygon features added to it.

Address Locator

arcpy.geocoding.AddPolygonFieldsToLocator(in_locator, polygon_features, polygon_output_fields)
NameExplanationData Type
in_locator

The locator (.loc file) where the fields will be added.

Note:

The locator cannot be a composite locator or a geocode service, including services from ArcGIS Enterprise or ArcGIS Online. You must add the polygon fields to the participating locators of a composite locator before publishing the locator as a geocode service.

Address Locator
polygon_features

The feature class containing the fields that will be added to the in_locator parameter value (fields will be appended to all geocoding output).

Feature Layer
polygon_output_fields
[[polygon_output_field, {name}],...]

The fields from the polygon feature class that will be appended to the locator.

Provide the field or field alias from the polygon_features parameter value, and the default field name will be used as the field name that is added to the locator. The default field name can be overwritten. The fields or name values provided for this parameter will define the names of the output fields from the polygon_features parameter value that will be returned in the geocode result. If the fields from the polygon features have aliases, the field alias will be used as the Name value.

  • Polygon Field(s)—The fields from the polygon_features parameter value that will be added to the locator.
  • Name—The name of the custom output field that will appear in the geocode results and locator properties.
Value Table

Derived Output

NameExplanationData Type
out_locator

The updated input locator with the output fields from the polygon features added to it.

Address Locator

Code sample

AddPolygonFieldsToLocator example 1 (stand-alone script)

Add polygon fields from a USA Census block group to a USA locator.

# Description: Add polygon fields from a USA Census block group feature class in a file geodatabase to a USA locator.

import arcpy

# Set local variables:
usa_locator = r"C:\Data\USA.loc"
polygon_features = r"C:\Data\USCensus.gdb\blkgrp"
polygon_output_fields = [["BLKGRP", "BLOCKGROUP"], ["POPULATION", "POPULATION"], 
                         ["VACANT", "VACANT"], ["HSE_UNITS", "HOUSE_UNITS"]]

# Run AddPolygonFieldsToLocator
arcpy.geocoding.AddPolygonFieldsToLocator(usa_locator, polygon_features, polygon_output_fields)

Environments

This tool does not use any geoprocessing environments.