2

I have done a bit of searching but have not found anything like what I am seeing when using ArcGIS Rest API. My setup is pretty much what is suggested on the documentation... I make a call to the suggest REST endpoint with text which returns a handful of suggestions that contain the one I am looking for. When the find REST endpoint is called with the magickey and text it returns an partial address (has everything except the street number). Below is my example:

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?Category=Street%20Address&f=json&text=5%20Barron%20Way,%20E

Which returns this JSON

{"suggestions":[{"text":"5 Barron Way, Eastman, Georgia, USA","magicKey":"GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUns8t7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false},{"text":"5 Barron Way, Evergreen, Montana, USA","magicKey":"GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnsNt7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false},{"text":"5 Barron Way, Everman, Texas, USA","magicKey":"GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnsbt7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false},{"text":"5 Barron Way, Exford, Victoria, AUS","magicKey":"GST7YMc0AM9UOsEm7jbtIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnskt7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false}]}

The first suggestion is selected which triggers a call to the following find endpoint

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?magicKey=GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUns8t7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF&f=json&outfields=AddNum,StName,StType,City,Region,Postal,Country&text=5%20Barron%20Way,%20Eastman,%20Georgia,%20USA

which returns this result

{"spatialReference":{"wkid":4326,"latestWkid":4326},"locations":[{"name":"Barron Way, Eastman, Georgia, 31023","extent":{"xmin":-83.145949999999999,"ymin":32.172302000000002,"xmax":-83.139949999999999,"ymax":32.178302000000002},"feature":{"geometry":{"x":-83.14294854543823,"y":32.17530230405913},"attributes":{"AddNum":"","StName":"Barron","StType":"Way","City":"Eastman","Region":"Georgia","Postal":"31023","Country":"USA"}}}]}

which as you can see does not contain the full address that the suggest REST endpoint told me about. Has anyone encountered this before? Are there any workarounds? I don't want to provide a suggestion to my end users only to find that it can't be used because the find endpoint doesn't return the address suggested.

1 Answer 1

1

Your request to suggest has category filtering while your find suggest does not.

I have found ESRI category filtering and magic keys to be very finicky.

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.