Geocode Error

385
3
04-24-2021 10:05 PM
DeanHowell1
Occasional Contributor III

We have a corporate geocode service that it accessed across a number of portals and all are having issues when uploading a CSV.

Some records in CSV are not being matched due to either that the address does not exist or data issues. For example  1 Johnston St, WINDSOR does not exist in data.  1 W Portland Rd, SACKVILLE Should be 1 WEST Portland Rd

There seems to be a mismatch in the way that Portal is undertaking the suggestions.

  1. If I use the manual address find tool, I get a match (after data editing)

DeanHowell1_0-1619326662750.png

 

The URL for the following search is as follows

 

https://...../GeocodeServer/suggest?f=json&text=WEST%20PORTLAND%20RD%2C%20SACKVILLE%20NSW%202756&max...

 

If I use the review process when loading the CSV the URL is as following

 

https://...../GeocodeServer/findAddressCandidates?SingleLine=1%20Johnston%20St%2C%20WINDSOR&f=json&o...

This case returns a 400 error.

 

DeanHowell1_1-1619326703304.png

Not sure why the find address tool is using the 'suggest' option but the review is using the 'findAddressCandidate'

Any help would be very much appreciated.

Regards

Dean

Tags (3)
0 Kudos
3 Replies
ChristaHash
Esri Contributor

Hi Dean, in order to make use of a suggest result in a findAddressCandidates request, you will need to pass one extra parameter (magicKey). When I grab the magicKey from your suggest result and add it into your findAddressCandidates request, I get the following:

https://7cizrcsygj.execute-api.ap-southeast-2.amazonaws.com/UAT/NSWPoint/GeocodeServer/findAddressCa...

You can think of a findAddressCandidates request as accepting either a text string or a suggest result object (the object containing both a text string attribute and a magicKey attribute, which helps our engine find the exact suggestion you're looking for). Please let me know if this helps or if you have additional questions. -Christa

DeanHowell1
Occasional Contributor III

Thanks @ChristaHash , how is the 'MagicKey' generated?

0 Kudos
ChristaHash
Esri Contributor

Hi Dean, the magicKey is generated as part of the output of the suggest request, and is basically just a key we generate to link a suggestion to a record in the data used to build the locator: 

dojo_request_script_callbacks.dojo_request_script70(
     {"suggestions":[
          {"text":"1 WEST PORTLAND RD, SACKVILLE NSW 2756","magicKey":"GANSW705879336","isCollection":false
          },
          {"text":"34 WEST PORTLAND RD, SACKVILLE NSW 2756","magicKey":"GANSW706501063","isCollection":false
          },
          {"text":"74 WEST PORTLAND RD, SACKVILLE NSW 2756","magicKey":"GANSW706501060","isCollection":false
          },
          {"text":"93 WEST PORTLAND RD, SACKVILLE NSW 2756","magicKey":"GANSW705892850","isCollection":false
          },
          {"text":"96 WEST PORTLAND RD, SACKVILLE NSW 2756","magicKey":"GANSW706524225","isCollection":false
          }]
     });

So when if you generate suggestions and choose one to use for search (findAddressCandidates), you can pull the magicKey and matching input text from the suggestion you choose. 

0 Kudos