Label | Explanation | Data Type |
Input Locator
| The locator or composite locator that will be packaged. | Address Locator |
Output File
| The name and location of the output locator package (.gcpk). | File |
Composite locator only: copy participating locators in enterprise database instead of referencing them (Optional) | Boolean | |
Additional Files (Optional) | The additional files that will be added 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) | The summary information that will be added to the properties of the package. | String |
Tags (Optional) | The tag information that will be added to the properties of the package. Multiple tags can be added or separated by a comma or semicolon. | String |
Summary
Packages a locator or composite locator and creates a single compressed .gcpk file.
Learn more about sharing an address locator as a locator package
Illustration
Usage
To create a package for a composite locator, ensure that the participating locators are stored in the file folder.
A warning is issued when this tool encounters an invalid locator. The invalid locator will not be packaged.
The locator package file (.gcpk) can be shared with other users.
Learn more about sharing an address locator as a locator package.
You can use the Extract Package tool and specify an output folder to unpack a locator package. You can also specify a folder in which to unpack packages in the Share and download options.
Each locator will be copied to a unique folder created in the consolidated folder.
Parameters
arcpy.management.PackageLocator(in_locator, output_file, {copy_arcsde_locator}, {additional_files}, {summary}, {tags})
Name | Explanation | Data Type |
in_locator | The locator or composite locator that will be packaged. | Address Locator |
output_file | The name and location of the output locator package (.gcpk). | File |
copy_arcsde_locator (Optional) | This parameter has no effect in ArcGIS AllSource. It remains only to support backward compatibility. | Boolean |
additional_files [additional_files,...] (Optional) | The additional files that will be added 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) | The summary information that will be added to the properties of the package. | String |
tags (Optional) | The tag information that will be added to the properties of the package. Multiple tags can be added or separated by a comma or semicolon. | String |
Code sample
The following Python script demonstrates how to use the PackageLocator function in the Python window.
import arcpy
arcpy.env.workspace = "C:/MyData/Locators"
arcpy.PackageLocator_management('Atlanta_composite', 'Altanta_composite.gcpk',
"", "#", "Summary of package",
"tag1; tag2; tag3")
Find and create 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
# Set environment settings
arcpy.env.overwriteOutput = True
arcpy.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_management(loc, os.path.splitext(loc)[0] + '.gcpk', "",
"#", "Summary of package","tag1; tag2; tag3")