Failing Composite locators in Arcgis Pro (Error: -2147467259 - Failed to execute (GeocodeAddresses))

2685
8
Jump to solution
08-05-2022 02:11 PM
BradleyMcCallum
New Contributor III

Hi!

I am struggling to create a composite locator using ArcGIS pro and getting an odd undocumented error. 

Background.

I've created 2 locators using 2 layers of points. One a merged layer of Canadian postal codes and US 5 digit Zip codes. I am using the postal code/zip code and City field to locate.

Canada/USA postal locations using the Postal Locality rule set.

BradleyMcCallum_0-1659730547384.png

The World City Country locator using the 'city' rules and I am using the city name and country name to locate.

BradleyMcCallum_1-1659730718773.png

 

On their own, they build successfully and work properly. 

The problem seems to be when I use these 2 locators to create a composite locator...(BTW, I want a composite locator so I have flexibility in controlling the parameters of each locator independantly)

I can sucecssfully build a composite locator, however, the red flag is that it seems to build too fast. I know Esri has made great strides in improving perforamce, but nothing in the software only takes 2 sec!!! 😉 Seriouly, I'm sure this tool is merging the locator .loc or the .xml files, regardless, I would expect some error checking or processing that would take a bit of time.

BradleyMcCallum_2-1659730938412.png

If I try to use this composite locator, I get the following error...

BradleyMcCallum_3-1659731077685.png

interstingly, the error inside the geoprocessing tool is different...

BradleyMcCallum_4-1659731210044.png

There isn't anyting that I'm 'breaking' in the Error 10 , but I can't find anything related to the -214746... error.

A quick google search shows this error related to some PY code, but not within a geoprocessing tool using Pro. 

AS far as the list that I'm geocoding, it's a table stored in a geodatabase. As I mentioned, the table geocodes fine with each locator independantly, so the error seems to be related to the composite locator itself. 

When I build the composite locator, I have the geoprocessing tool set to the following...

BradleyMcCallum_5-1659732975777.png

I'm a little confused by the field mapping. In one locator I am using Postal code and city and in the other I'm using city and country. There is overlap between the 2 locators.I have removed the 'postal' mapping from the world city locator but I still get the same error.

They both have a country code and I'm using a country code look up table in both because the file I'm geocoding uses a 2 digit ISO code and the software requires 3 digits. 

Ideally, the locator would geocode all the Canada postal and US Zip codes and anything that didn't get geocoded with this locator would be sent to the world city locator. 

This post is getting long, so if anyone has any feedback or comments on this error or has run into this with their own work, please contribte to the solution.

thanks!

Brad McCallum

 

 

0 Kudos
1 Solution

Accepted Solutions
ShanaBritt
Esri Regular Contributor

@BradleyMcCallum Thanks for the additional information. If your workflow includes geocoding your customer data using multiple fields, when you build the composite locator you will need to keep all of the Input Fields that come from the participating locators (CanAM_PostalOn3 & WorldCityOn3) and not remove any from the Field Mapping as you've done below. The red area is the cause of your failure, it should list all of the input field names (address, address2, address3, etc....). If you keep your composite configured like below you will need to concatenate the customer address data into a single field and geocode using the single field.

 

-Shana

ShanaBritt_0-1665727743823.png

 

View solution in original post

0 Kudos
8 Replies
ShanaBritt
Esri Regular Contributor

@BradleyMcCallum The Create Composite Address Locator ran quickly considering the composite locator contains path references to the participating locators. Nothing complicated is happening when creating a composite locator. It is similar to how data is referenced in ArcMap and Pro project files.

- It does seem like something is off about the composite. If you open the properties of the composite locator are there any warnings or anything red in the locator properties dialog?

- Can you provide details about the input parameters for the Geocode Table pane or Geocode Addresses tool? Are you geocoding by country name or country code?

- What version of ArcGIS Pro are you using?

I understand that your goal is to work with a composite, but curious to know if you create a multirole locator of Postal Locality and City roles and use it to geocode your data if you get the same error. 

If you wanted to share this data privately let me know.

-Shana

0 Kudos
BradleyMcCallum
New Contributor III

Hi Shana!

Sorry for the late reply as I've been on vacation. I'll answer your questions with as much information as I can...

1)  Nothing red or underlined, everything in the properties dialog looks fine, 'normal'. I can make changes to the parameters and they will be saved. Nothing turns red.

2) Here are the dialogs for the 2 locators. 

BradleyMcCallum_2-1660660742781.pngBradleyMcCallum_1-1660660417518.png

and the dialog for the composite. I am taking these screenshots from the history pane/pannel.

BradleyMcCallum_0-1660660215216.png

with respect to geocoding against country name or country code, I am geocoding against a 2 digit country code in my customer data, which, I understand is the reason I am using an alternate field table in the locator. When building the locator, I reference the country ID with my look up table as well as the 'country join id'. 

When using the locator, I only have one option for the 'country' field, so I assume that the country code is the country code in the locator and it's also using the look up table that I'm linking with the alternate name table, which is my 2 -> 3 digit country code table.

I do get a warning when I build the individual locators, but nothing when I build the composite.

The warning is 003107 - the 'ISO_3' data field is mapped to more than one role field in 'postal locality' role.

BradleyMcCallum_0-1660669666965.png

3) I am using ArcGIS pro 3.0.0

I hope this answers your questions.

 

thanks,

Brad

0 Kudos
ShanaBritt
Esri Regular Contributor

@BradleyMcCallum I believe the error you are getting is because when the composite was created Input fields were removed and the composite locator requires that all of the input fields from the participating locators are part of the composite input fields. When the input fields in the field map section are removed the number of input fields of the composite does not match the number of input fields in the participating locators. If the input field mapping is Multiple Fields, you will get the error, but if the full address is in a single field in the table and the Input Address Fields parameter is set to Single Field, you should not get the error.

To confirm this I need to know  what the input parameters for the Geocode Table pane or Geocode Addresses tool when geocoding the table?

ShanaBritt_0-1663919211749.png

 

0 Kudos
BradleyMcCallum
New Contributor III

Hi Shana!

Thanks for the feedback. To answer your question, I use multiple fields to geocode, since we store our customer data in separate fields. 

The overall goal is to process our cusomers in Canada at the postal/city level, then geocode our USA customers at the 5 digit Zip code/city level and finally, any international customers at the City/country level. I need the postal/city in Canada because there are multiple cities that share postal codes. 

I shoudl also mention that my long term goal is to publish this locator as a web service, where other analysts on my team can geocode customer files via our enterprise server using Python, API calls, etc...

I can achive my needs with 2 locators; a CAN postal code and Zip+5 locator and a World City locator. 

I use 3 fields; Postal/Zip+5, City and Country to accomplish this, where City is common in both locators.

When I build the locators, I only use the required fields, so in my examples, I use postal/city/country for the postal locality rules and city/country for the city rules. I have a look-up table for country codes and that's about it. See my screenshots above for details. 

I hope this answers your questions. 

thanks,

Brad

0 Kudos
ShanaBritt
Esri Regular Contributor

@BradleyMcCallum Thanks for the additional information. If your workflow includes geocoding your customer data using multiple fields, when you build the composite locator you will need to keep all of the Input Fields that come from the participating locators (CanAM_PostalOn3 & WorldCityOn3) and not remove any from the Field Mapping as you've done below. The red area is the cause of your failure, it should list all of the input field names (address, address2, address3, etc....). If you keep your composite configured like below you will need to concatenate the customer address data into a single field and geocode using the single field.

 

-Shana

ShanaBritt_0-1665727743823.png

 

0 Kudos
BradleyMcCallum
New Contributor III

Hi Shana!

Sorry for the late reply. OK, so it seems there is no way to streamline the input of a composite locator.

Quick question. If I was to share this composite locator as a geocoding service on our ArcGIS Enterprise Server, would the person interacting with the locator (using Python) be required to include all the <NULL> fields, if batch geocoding or could they just pass the 3 fields that we use in our customer database and identify each one; {Ciy: "Halifax", Postal: "H0H 0H0", Country: "CAN"} ?

thanks,

Brad

0 Kudos
ShanaBritt
Esri Regular Contributor

Brad:

Anytime you are using ArcPy.GeocodeAddresses() with any locator (utility service, from an ArcGIS Server connection, Enterprise portal, or local), you must include all of the input fields from the composite locator even if they are the <NULL> fields. For raw REST requests or Python code that accesses the REST API you can pass the fields that you need. So in your case for the GeocodeAddresses REST request you can use  {Ciy: "Halifax", Postal: "H0H 0H0", Country: "CAN"}.

-Shana

0 Kudos
BradleyMcCallum
New Contributor III

Hi Shana!

OK, this is great to know. 

thanks,

Brad

0 Kudos