Package Locator (Geocoding)

License Level:BasicStandardAdvanced

Summary

Package a locator or composite locator to create a single compressed .gcpk file.

Learn more about sharing your locator as a locator package

Illustration

Locator package structure
The folder structures of an unpacked locator package that contains a locator, and an unpacked composite locator package that contains the composite locator and its participating locators.

Usage

Syntax

PackageLocator_geocoding (In_locator, output_file, {copy_arcsde_locator}, {additional_files}, {summary}, {tags})
ParameterExplanationData Type
In_locator

The locator or composite locator that will be packaged.

Input address locator
output_file

The name and location of the output locator package (.gcpk).

File
copy_arcsde_locator
(Optional)

Specifies whether participating locators will be copied or their connection information will be preserved in the composite locator. This option only applies to composite locators.

  • COPY_ARCSDEAll participating locators, including locators in ArcSDE, will be copied to the consolidated folder or package. This is the default.
  • PRESERVE_ARCSDE Connection information of the participating locators that are stored in ArcSDE will be preserved in the composite locator.
Boolean
additional_files
(Optional)

Adds additional files to a package. Additional files, such as .doc, .txt, .pdf, and so on, are used to provide more information about the contents and purpose of the package.

File
summary
(Optional)

Adds Summary information to the properties of the package.

String
tags
(Optional)

Adds Tag information to the properties of the package. Multiple tags can be added or separated by a comma or semicolon.

String

Code Sample

PackageLocator example 1 (Python window)

The following Python script demonstrates how to use the PackageLocator tool from within the Python window.

import arcpy
arcpy.env.workspace = "C:/MyData/Locators" 
arcpy.PackageLocator_geocoding('Atlanta_composite', 'Altanta_composite.gcpk', "COPY_ARCSDE", "#","Summary of package","tag1; tag2; tag3")
PackageLocator example 2 (stand-alone Python script)

Finds and creates individual locator packages for all of the locators that reside in a specified folder.

# Name: PackageLocatorEx.py
# Description:  Find all the locators that reside in a specified folder and create a locator package for each locator.


# import system modules
import os
import arcpy

from arcpy import env

# Set environment settings
env.overwriteOutput = True
env.workspace = "C:/MyData/Locators" 

# Loop through the workspace, find all the locators and create a locator package using the same name as the locator.
for loc in arcpy.ListFiles("*.loc"):
    print "Packaging " + loc
    arcpy.PackageLocator_geocoding(loc, os.path.splitext(loc)[0] + '.gcpk', "COPY_ARCSDE", "#","Summary of package","tag1; tag2; tag3")

Environments

Related Topics

Licensing Information

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