Hi. The documentation for the ArcGIS REST API reverseGeocode operation says that the `location` parameter can take one of three forms:
In my testing, only the first option works. Option 2 and 3 return 'Error occurred while processing request' with no error message and a description 'http.400'
For my testing, i'm using the URL from the Examples within the documentation page, and switching out the various options for `location` and dropping the 'token' parameter. Like this:
https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?f=pjson&featureTypes=&location=-117.205525,34.038232
https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?f=pjson&featureTypes=&location={x:103.876722,y:1.3330736}
https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?f=pjson&featureTypes=&location={ "x": 11563503, "y": 148410, "spatialReference": { "wkid": 3857 } }
Only the top one is successful. Is the documentation off, or is there a bug in the reverseGeocode endpoint?
Thank you.
Solved! Go to Solution.
Hello @Trippetoe, I don't think I will be able to help you further.
Still, after a quick research, I found three 'somehow relevant' old Esri Community posts that you might want to look at: 1, 2, and 3. And I also see that the ArcGIS Geocoding Service was updated in September; maybe there was some undocumented change?
I would be curious to know the solution. Good luck!
Hello @Trippetoe,
Did you review if the syntax of your 2nd and 3rd requests match exactly the Esri documentation examples? I seem to see some minor space differences. I'm not sure if those might make a difference, but I would check since you get a 400 error message.
Hi @rcGIS . Thanks for taking a look at my question.
I reviewed the requests, and I feel pretty good about the syntax. I reran the second one with an exact copy / paste. The browser did its URL encoding with a final URL of https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location={x:%2010.... I got the same response http.400 'Error occurred while processing result
Hello @Trippetoe, I don't think I will be able to help you further.
Still, after a quick research, I found three 'somehow relevant' old Esri Community posts that you might want to look at: 1, 2, and 3. And I also see that the ArcGIS Geocoding Service was updated in September; maybe there was some undocumented change?
I would be curious to know the solution. Good luck!
Thanks @rcGIS . The three links you provided were helpful. They sent me down the path of getting to know online URL encoders a bit more than i had known them before. Eventually, i stumbled on an encoded URL that seemed to do the trick (for example, this is the third link in my original post fully encoded):
That request got me a valid response from the service. I'm gonna call that a win, and move on.
Thanks again for your help
I'm glad I could be of some assistance, @Trippetoe. Thank you for sharing those additional details, too.