Skip to content
Loading…
This layer is editable and shared with the public. To prevent unwanted editing, unshare this item or approve it for public data collection.
Finish setting up your layer
Describe your item below. Add fields on the Data tab. Configure editing on the Settings tab. Configure drawing and pop-ups through Map Viewer or Visualization tab.

A script that updates geocoding services with the latest version of the locator. A brief summary of the item is not available. Add a brief summary about the item.

‎Code sample by

Item created: Jul 3, 2019 Item updated: Dec 9, 2019 Number of downloads: 1,440

Snapshot last refreshed:

1968 characters left.

Description

This zip archive contains 3 files:
- README.txt
- Update.py
- Config.ini

The Update.py script updates a locator service on your ArcGIS Enterprise Organization. You are able to pass inputs to the script using the Config.ini file. You will need to create a new locator with your latest available reference data using the CreateLocator tool in ArcGIS Pro. Then, you can use this script to update your existing geocoding service with the new locator.

The following script is meant to automate the process described in the "Update a locator service" section here: https://pro.arcgis.com/en/pro-app/help/data/geocoding/keep-your-locator-up-to-date.htm#ESRI_SECTION1_35E8B1CBDACB44C2AD4B5D486E9FBFEE

Make sure to open the Config.ini file and read its comments about each parameter thoroughly. Then, set the parameters in the Config.ini file so that the script can update your geocoding service. 

Note: If you are updating a geocoding service that's federated with a portal, you NEED to call arcpy.SignInToPortal() first in order for the publishing/overwrite to work. If you are updating a non-federated server, this script should work out-of-the-box once you update the Config.ini file.

Additional Note: We recommend using Pro 2.5 to overwrite your geocoding services. In Pro 2.5 you can overwrite services on both standalone server and on a federated Portal. This script is meant for users that are using an earlier version of Pro.

Requirements:
The script must be run on a machine with Pro 2.3 or later.

Usage:
After updating the Config.ini with the appropriate inputs...

"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" Update.py

An in-depth description of the item is not available.

Layers

Ground Layers

Tools

Tables

Basemap

Project Contents:

Solution Contents

Contents

Layers

Screenshots

Terms of Use

Copyright 2019 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

No special restrictions or limitations on using the item's content have been provided.

Comments (9)

Sign in to add a comment.

jzumbado@forestgrove_or.gov_coffg Item Owner commented 2 years ago Delete Reply

Follow this video on how to implement https://community.esri.com/t5/devsummit-conference-videos/updating-your-locator-service/m-p/976744

JSpence@bellevuewa.gov_cobgis Item Owner commented 3 years ago Delete Reply

Is this still a relevant code example?

JSpence@bellevuewa.gov_cobgis Item Owner commented 3 years ago Delete

Awesome! Thank you for pointing me in the exact direction I needed. Frustrating morning trying to track this very python example down. :)

ArcGISGeocodingTeam Item Owner commented 3 years ago Delete

You can now overwrite geocode services in the Pro UI. If you want to automate this process, you can still use this script or the code sample provided here: https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/creategeocodesddraft.htm

rgrichards Item Owner commented 5 years ago Delete Reply

For federated servers does it matter if the AGS connection is to the web adaptor or directly to the server on port 6443?

rgrichards Item Owner commented 5 years ago Delete

Thanks again. I seem to be having a problem by adding a simple loop of AGS connections to this script. What sort of dependencies does this script have on the ArcGIS Pro installation? It does not seem to work when not signed into a portal and if signed into a portal the script will not work looping thru connections. Can I contact your team or tech support to show simple examples of failures? Changing 6 lines of codes to this script to support a loop of connections fails with ERROR 999999 everytime on the 2nd publication. line 61: def main(connection) line 210: ags_connection = connection line 264: arcpy.env.overwriteOutput = True federatedConnections = [r'\\server\share\server on test (admin).ags', r'\\server\share\server on prod (admin).ags'] for connection in federatedConnections: main(connection)

[Deleted User] Item Owner commented 5 years ago Delete

You should still be able to create the AGS connection against server/6443. But if the server is federated, you'll need to enter the credentials to the Portal that is federated to the server. You can always double-click in ArcMap and it will tell you if the AGS connection you created is valid.

rgrichards Item Owner commented 5 years ago Delete

Thank you victor7669 what if we turn off server administrative option thru the web adaptor? In this scenario should we connect directly to server/6443?

[Deleted User] Item Owner commented 5 years ago Delete

For a federated server, create the AGS connection using ArcMap through the web adaptor. Double-click the newly created AGS connection in ArcMap to ensure that it is valid. For the AGS file credentials, enter in the credentials for the portal that is federated to the server you are trying to connect to.

Item Information

LowHigh

Item Information

LowHigh

Make your item easy to find, understand, and use by providing this information.

    Details

    Dashboard views: Desktop

    Creating data in:

    Published as:

      Other Views:

        Dependent items in the recycle bin

          Applicable: 2d

          Size: 4.537 KB

          Attachments size: 0 KB

          ID: 54e8aab14f6e4c61b65b9dd9ab451503

          Image Count: 0

          Image Properties

          Layer Drawing

          Using tiles from a cache

          Dynamically from data

          Share
          Owner

          ArcGISGeocodingTeam

          Folder

          Categories

          This item has not been categorized.

          Assign Category
          Edit Tags
          Credits (Attribution)
          No acknowledgements.

          URL View
          WMTS View
          Loading…