tigris icon indicating copy to clipboard operation
tigris copied to clipboard

Error of using tigris::call_geolocator_latlon()

Open Helen-Jiahuan-H opened this issue 1 year ago • 2 comments

Hello,

I have encountered an error when I run the function triggers::call_geolocator_latlon(), which is attached as a screenshot shown below.

Screen Shot 2023-10-30 at 4 03 19 PM

The error was "Bas Gateway (HTTP 502)", so I wonder whether this is a problem with the server. However, I looked into the link (https://geocoding.geo.census.gov/geocoder/geographies/coordinates?) used in the source code of call_geolocator_latlon function and it seems to be fine.

Could anyone provide any insights on how I could fix this issue? Thank you very much in advance!

Best, Helen

Helen-Jiahuan-H avatar Oct 30 '23 20:10 Helen-Jiahuan-H

Hey Helen, I can't reproduce this right now.

> tigris::call_geolocator_latlon(35, -110)
[1] "040179601002001"

Can you try the code above and make sure it's not either a transient problem on Census's end, or else being caused by some odd values in your lat/long values?

lpiep avatar Oct 30 '23 20:10 lpiep

Hey Helen, I can't reproduce this right now.

> tigris::call_geolocator_latlon(35, -110)
[1] "040179601002001"

Can you try the code above and make sure it's not either a transient problem on Census's end, or else being caused by some odd values in your lat/long values?

Hi Logan,

Thanks for getting back to my question so promptly! I tried the code and it is working. I revised my values to up to 4 decimal places and now it seems working. I wonder what is the maximum number of decimal places that the latitudes and longitudes can have to feed into the call_geolocator_latlon() function?

Thank you!

Helen

Helen-Jiahuan-H avatar Oct 30 '23 21:10 Helen-Jiahuan-H