Rebuild locator or network and restart service script

12-13-2012 07:50 AM
Status: Open
New Contributor II
I need to create a python script to rebuild an address locator based on address points, an address locator based on street centerlines and a composite locator that contains both the address points and street centerlines. Once the rebuild of the locators is done, I need to restart the gecoding service. I also need to rebuild a network based on the street centerlines and then restart the Routing Service.
I have seen the “Example: Stop or start all services in a folder” ( example on the ArcGIS Resources page. We are not set up to use folders at this time and I do not want to have to stop and start all services, just the specific ones needed.
It would be great to have a script to easily rebuild locators and networks and then restart the corresponding services on the server. We have previously done this through a batch file that we downloaded from the ArcScripts page. But now at 10.1, it does not work.
I have the same requirement and have spent a great deal of time attempting to automate this process. However, every time I use python to rebuild or modify address locators in any way they inevitably become corrupt. Creating a new address locator is possible with python, but to date there are no arcpy tools available to modify the address locator properties (e.g. Geocoding Options, Performance). Manually performing a data update for ArcGIS Geocoding Services is very time-consuming and it would be extremely helpful if there were reliable arcpy tools available to assist in this process.

I have the same problem with the address locator becoming corrupted when using python to rebuild composite locator.  It is extremely annoying.


You do not need to rebuild the composite locator as you just rebuild the individual address locators that make up the composite address locator.

I myself had a bat file setup that ran 3 python scripts for this specific scenario.  The first python script stopped the geocode service(s), the next python script rebuilt the address locators that were the source of the geocode service, and the third python script started the geocode service(s).  These scripts worked relatively well (not 100%) for 1.5 years, but now with changes to my org's environment, I am encountering multiple issues with these scripts that are causing them to fail both when stopping geocode services and rebuilding the address locators.  Even if the geocode service gets stopped properly to release locks on the address locators, the rebuild address locator script also fails.

I have been working with ESRI technical support on these issues for a few weeks with very inconsistent results on my org's network.