Select to view content in your preferred language

findAddressCandidates not returning data without searchExtent

711
2
07-05-2022 08:42 AM
FaraazHabeebuddin
New Contributor

I am trying to search using findAddressCandidates. Without searchExtent, no data is being returned whereas with searchExtent, data is being returned. Can someone help me understand what is this issue? Example: 1) https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?addres...searchExtent=-88.263982%2c41.56898%2c-87.562231%2c42.439433&forStorage=False&outfields=*&f=pjson (Gives result) 2) https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?addres... (NO Result)

0 Kudos
2 Replies
myESRIUName
New Contributor

Not sure how much this will help, but I'll guess the problem is somehow related to the service having a harder time finding a match for the address provided simply because of the volume of records it would need to search. Perhaps in the interests of speed, the search can't zero in on the correct record when searching the entire world; whereas, with the searchExtent limiting what needs to be searched, it's able to zero in and look at a more specific collection of records somehow.

I only suggest this because the lack of a searchExtent parameter doesn't seem to be the problem; in and of itself, that is.

If you use the same REST request you provided without a searchExtent (which doesn't return any candidates) but change the address parameter to "4100 S Normal Ave Chicago" rather than just "4100 S Normal Ave", it returns the same candidate your successful request does.

0 Kudos
Raul_Jimenez
Esri Contributor

@FaraazHabeebuddin I'm afraid this is the expected behavior. Without any zone info (city, state, zip, etc.) it is very hard to tell where “4100 S Normal Ave” is supposed to be.

When you constrict it to an extent, you are more likely to get a match, which is exactly the behavior you’re seeing.

Also, as a general practice, pass "Location" instead of passing "Search Extent". "Location" should be the point at the center of your map that geocoding results should focus around. This is our recommendation for the best results.

Another option would be to use the auto-complete first and send the first result:

thumbnail_image001.png

I hope this helps.

Thanks for your patience.

0 Kudos