1

I have a table of about 1500 addresses that updates and geocodes nightly using task scheduler and a couple of python scripts. The majority of these addresses are in the county for which I work. We have a local composite locator that can get all these addresses no problem, but the locator fails to match the addresses outside the county because it is built on county-wide datasets. The addresses that do occur outside the county range all over the United States.

So, instead I have it set up to connect to and use the ESRI World Geocoding service to geocode the addresses each night, which works like a charm. However, with 1500+ addresses geocoding nightly, this is very credit-intensive, and since we can geocode the majority of them without using the service, I am looking for a way to use our local locator first, and then rematch the unmatched (out of county) addresses using the ESRI World Geocoding service. Any thoughts?

  • Start with local, do the rest in agol – FelixIP Aug 4 '16 at 6:19
  • @FelixIP With just slight expansion into a couple of sentences, I think your comment looks like an answer. – PolyGeo Sep 5 '16 at 3:01
0

ESRI has a 2016 post that says you can do this with VB. https://support.esri.com/en/technical-article/000003504

I've never done this, but straight from their site it mentions the following steps:

  1. Procedure In ArcCatalog, create the geocoding service you want to use to rematch the unmatched addresses in the geocoded shapefile or feature class.
  2. Paste the following VBA code into the VBA editor in ArcCatalog. This code assumes you already have a reference to the geocoded shapefile or feature class and to the geocoding service (in this case, a ZIP (5-Digit) geocoding service) you want to use to rematch the unmatched addresses. This code also assumes the geocoded shapefile or feature class has a field that contains the 5-digit ZIP code of the addresses (in this case, a field named "ARC_Zone").

Code:

Sub AttachNewLocator(pFeatureClass As IFeatureClass, _
    pLocator As ILocator)
  Const FIELD_ZIP_NAME = "ARC_Zone"
  Dim pLocatorAttach As ILocatorAttach
  Dim pLocatorDataset As ILocatorDataset
  Dim strMatchFields As String

  Set pLocatorDataset = pLocator
  Set pLocatorAttach = pLocatorDataset.LocatorWorkspace
  strMatchFields = MatchFields(pLocator)
  pLocatorAttach.AttachLocator pLocator, pFeatureClass, _
    pFeatureClass, FIELD_ZIP_NAME, pFeatureClass.OIDFieldName, _
    pFeatureClass, strMatchFields, pFeatureClass.OIDFieldName
End Sub

Function MatchFields(pAddressGeocoding As IAddressGeocoding) As String
  Dim i As Long
  Dim pMatchFields As IFields
  Dim strMatchFields() As String

  Set pMatchFields = pAddressGeocoding.MatchFields
  ReDim strMatchFields(pMatchFields.FieldCount - 1)
  For i = 0 To pMatchFields.FieldCount - 1
    strMatchFields(i) = pMatchFields.Field(i).Name
  Next i
  MatchFields = Join(strMatchFields, ",")
End Function
  1. Write a procedure in VBA to obtain a reference to the geocoded shapefile or feature class and the geocoding service, and to call the AttachNewLocator procedure. There are numerous examples of how to obtain a reference to a shapefile or feature class in the ArcObjects Developer Help.
  2. Run your procedure to attach the new geocoding service to the geocoded shapefile or feature class.
  3. In ArcCatalog, rematch the unmatched addresses in the geocoded shapefile or feature class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.