Overwrite Locator Service using Pro

3189
20
01-08-2019 06:11 AM
mpboyle
Occasional Contributor III

I recently published a composite locator service using Pro to our Portal (with a federated Server).  I re-built the individual locators and would now like to re-publish / overwrite the composite locator service, but don't see a way of doing that within Pro.

Am I missing a tool or toolbar somewhere?  How does one update / overwrite locator services using Pro?

Tags (1)
0 Kudos
20 Replies
DanielCota1
Occasional Contributor

Hi Matthew Boyle‌,

Presently, there is not a means to formally overwrite a geocode service. What you can do is either update the data for the service or publish a new service altogether and re-implement that into any online portals or web apps.

For example, if you have a composite locator, you can follow these steps to update the service:

1. Stop the geocode service
2. Update the reference data for the individual locators
3. Rebuild the individual locators

4. Start the geocode service

Hope this helps!

-Daniel

0 Kudos
ShanaBritt
Esri Regular Contributor

For ArcGIS Pro 2.3 the parameter 'overwrite_existing_service' was added to the CreateGeocodeSDDraft ArcPy publishing function. Once ArcGIS Pro 2.3 is available you would be able to overwrite the locator service via Python using Pro. Later this week this help topic will include the new parameter. At this time there is no option in the UI to overwrite existing locator services. https://pro.arcgis.com/en/pro-app/arcpy/functions/creategeocodesddraft.htm 

0 Kudos
ShanaBritt
Esri Regular Contributor

ArcGIS Pro 2.3 went live today and if you are able to install it try using the Python option I suggested above.

0 Kudos
LeviCecil
Occasional Contributor III

I'm having trouble with this in Pro 2.4.2. overwrite_existing_service=True is not working inside Pro or Python 3.6.8. IDLE. Will this be addressed at Pro 2.5? I need to rebuild and overwrite a locator on our server once or twice a week.   

0 Kudos
MichaelVolz
Esteemed Contributor

Does the overwite service parameter stop the existing service whose associated address locator would need to be stopped in order to remove locks on a file geodatabase if that was the data source?  Is this the recommend procedure for updating a geocode service going forward?

I ask because it seems like the overwrite task would occur after rebuilding the address locator which could only occur if the service was stopped at that point to clear the file geodatabase locks that would throw up an error.

0 Kudos
LeviCecil
Occasional Contributor III

I can overwrite Geocode services in Python 2.7, but not in Python 3.6 or in Pro. 

0 Kudos
MichaelVolz
Esteemed Contributor

So when you overwrite a geocode service in python 2.7, do you need to first stop the geocode service to rebuild the associated address locator?

0 Kudos
LeviCecil
Occasional Contributor III

No, it just overwrites. If I try to run the same script in Python 3.6.8, it stops the locator on the server and then fails to upload the service definition. 

And I've found another issue. I create the locator in Pro/Python 3 using arcpy.geocoding.CreateLocator. This tool has no capabilities parameters (geocode, suggest, etc). I can't use the older tool arcpy.CreateAddressLocator_geocoding because suggestions are totally screwed up when the service is consumed in a web app. If I publish the locator straight from Pro (created with arcpy.geocoding.CreateLocator), everything works. If I create the locator in Python 3.6, and then publish it in 2.7, then suggestions are turned off. Turning them on and restarting the service has no effect. So no matter what, I have to physically publish the locator to the server or it won't work correctly. I need this process to be fully automated end to end, because the address points data I'm using is updated by the city on a bi-weekly basis. 

0 Kudos
ShanaBritt
Esri Regular Contributor

The geocoding team put out a script to help automate updating a geocode service using Python that is installed with ArcGIS Pro. https://www.arcgis.com/home/item.html?id=54e8aab14f6e4c61b65b9dd9ab451503  The script is meant to automate the process described in the "Update a locator service" section of the 'Keep your locator up to date' help topic here: https://pro.arcgis.com/en/pro-app/help/data/geocoding/keep-your-locator-up-to-date.htm#ESRI_SECTION1_35E8B1CBDACB44C2AD4B5D486E9FBFEE

Try using the script to see if you still encounter the problems you are having with updating the service.

0 Kudos