Select to view content in your preferred language

Updating Address Locator in Portal

03-31-2020 05:40 PM
New Contributor III

Hey folks,

Got a question regarding updating of data within my Address Locator that I have shared to our Portal Env.  The data within our Address Locator is referencing a file geodatabase that resides on our ArcGIS Server.  The file geodatabase has been registered with our Datastore so we don't have data copied to the managed Datastore (PostgreSQL).  The file geodatabase is updated on a weekly basis.  Will I also need to update the Address Locator in Portal?  Since the source data is updated I'm thinking I will most likely need to run a rebuild and overwrite the existing Locator Service in Portal.

Any thoughts or suggestions would be appreciated.

UPDATE: Looks like I might have found my answer

Rebuilding address locators using a geoprocessing tool—Help | Documentation 

"When you make edits to your geocoding reference data, either by adding or deleting features or rows or by editing the address attributes they contain, you must rebuild your address locator if you want to geocode addresses against the current version of the reference data. "

So, I wrote a Python script to stop the locator service, rebuild the locator service and start the service back up.  Easy as py.


0 Kudos
3 Replies
Regular Contributor

We rebuild the locators weekly, just after updating the file.gdbs

Logically it seems to make sense

-Paul Davidson

0 Kudos
New Contributor II

Hello Jim,

Do you mind sharing your code? This is something I would like to do.



0 Kudos
New Contributor III

import arcpy,os,sys,time
from arcpy import env
env.workspace = "<location_of_data>"

# Set local variables:
address_locator = "Parcel_Maptaxlot_Gazetteer_Locator"

   # Stop the locator service on ArcGIS Server
   print "Stopping " + address_locator

   # Another Python script to stop services
   os.system(" STOP")
   print "Finished stopping service"

   # Rebuild locator
   print "Start rebuilding: " + address_locator
   print "Finished rebuilding: " + address_locator

   # Start the locator service on ArcGIS Server
   print "Starting " + address_locator
   os.system(" START")
   print "Finished starting service"


   print "There was a problem"
   print os.sys.exc_info()[1]

0 Kudos