Clip Locator (Geocoding)

Summary

Clips a locator based on an area of interest or extent and creates a locator with a smaller extent and size.

Usage

  • This tool can clip a locator based on features in a layer, selected features in a layer, or an extent. The output is a new locator with a smaller extent.

  • When geocoding places in a targeted study area, use this tool to clip the locator to that area to reduce the locator's size and to only return geocode results within the smaller extent. When the locator is clipped, the reference data indexed in the locator will also be clipped. No results will be returned when searching for addresses outside of the extent of the clipped locator.

  • A ArcGIS StreetMap Premium license is required to clip ArcGIS StreetMap Premium locators.

  • If the Input Locator value is a composite locator, the participating locators of a composite locator will be clipped and saved to a subfolder of the output location. The composite locator will be saved to the output location.

  • Geocode services that are participating locators in a composite locator will not be clipped.

Parameters

LabelExplanationData Type
Input Locator

The locator (.loc file) that will be clipped.

Note:

Geocode services or composite locators that contain geocode services, including services from ArcGIS Enterprise or ArcGIS Online, as participating locators are not supported. If the service is a participating locator in a composite locator it will not be clipped.

Address Locator
Output Locator

The clipped output locator (.loc file).

Address Locator
Area of Interest
(Optional)

The polygon layer that defines an area of interest that will be used to clip the locator.

This parameter overrides the Extent parameter.

Feature Layer
Extent
(Optional)

Specifies the extent that will be used to clip the locator.

  • Default—The extent will be based on the extent of the map at the time the tool runs. This is the default.
  • Current Display Extent—The extent will be equal to the visible display. This option is not available when there is no active map. The extent does not change if the map changes after this option is specified.
  • As Specified Below—The extent will be based on the minimum and maximum extent values specified.
  • Browse—The extent will be based on an existing dataset.
Extent

arcpy.geocoding.ClipLocator(in_locator, out_locator, {area_of_interest}, {extent})
NameExplanationData Type
in_locator

The locator (.loc file) that will be clipped.

Note:

Geocode services or composite locators that contain geocode services, including services from ArcGIS Enterprise or ArcGIS Online, as participating locators are not supported. If the service is a participating locator in a composite locator it will not be clipped.

Address Locator
out_locator

The clipped output locator (.loc file).

Address Locator
area_of_interest
(Optional)

The polygon layer that defines an area of interest that will be used to clip the locator.

This parameter overrides the extent parameter.

Feature Layer
extent
(Optional)

Specifies the extent that will be used to clip the locator.

  • DISPLAY—The extent will be equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent

Code sample

ClipLocator example 1 (stand-alone script)

Clip the USA locator using a county polygon.

import arcpy

usa_locator = r"C:\Data\USA.loc"
my_clipped_locator = r"C:\Data\SanDiego.loc"
my_san_diego_polygon_layer = r"C:\Data\SanDiegoCounty.shp"

# Run ClipLocator
arcpy.geocoding.ClipLocator(usa_locator, my_clipped_locator, my_san_diego_polygon_layer)
ClipLocator example 2 (stand-alone script)

Clip the USA locator using an extent.

import arcpy

usa_locator = r"C:\Data\USA.loc"
my_clipped_locator = r"C:\Data\SanDiego.loc"

# Define the extent using an arcpy Extent object
my_san_diego_extent = arcpy.Extent(
    -13115569.084655, 3826591.24577018, -12897364.810527, 3969918.09780486, 
    spatial_reference=arcpy.SpatialReference('WGS 1984 Web Mercator (auxiliary sphere)'))

# Run ClipLocator
arcpy.geocoding.ClipLocator(usa_locator, my_clipped_locator, None, my_san_diego_extent)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics