Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble specifying vintage with call_geolocator_latlon() #151

Open
bencarey86 opened this issue Oct 28, 2022 · 3 comments · May be fixed by #173
Open

Trouble specifying vintage with call_geolocator_latlon() #151

bencarey86 opened this issue Oct 28, 2022 · 3 comments · May be fixed by #173

Comments

@bencarey86
Copy link

Hi,
I am trying to specify a vintage within call_geolocator_latlon() but receive an error each time, regardless of the year I input.

For example, call_geolocator_latlon(lat = 32.4, lon = -86.5) returns [1] "010010208011015", but
call_geolocator_latlon(lat = 32.4, lon = -86.5, vintage = 2010) returns Bad Request (HTTP 400).

I wasn't able to find any examples of specifying the vintage on the internet, so I'm not sure if I'm just using the function incorrectly or if there is a bigger issue. Thanks!

@bencarey86 bencarey86 changed the title Trouble specifying vintage with call_geolocator_latlon() Trouble specifying vintage with 'call_geolocator_latlon()' Nov 2, 2022
@bencarey86 bencarey86 changed the title Trouble specifying vintage with 'call_geolocator_latlon()' Trouble specifying vintage with call_geolocator_latlon() Nov 2, 2022
@walkerke
Copy link
Owner

walkerke commented Dec 5, 2022

@bencarey86 thanks for filing this. The geolocator functions in tigris need some maintenance and I may deprecate them in favor of a new interface. This will take me a little time to do as even getting the vintage right isn't working.

I did implement this over on the Python side so you can see the direction I'm going:

from pygris.geocode import geolookup

geolookup(latitude = 32.4, longitude = -86.5, benchmark = "Public_AR_Census2020", vintage = "Census2010_Census2020")

@dteck
Copy link
Contributor

dteck commented Dec 5, 2022

Hi, I am trying to specify a vintage within call_geolocator_latlon() but receive an error each time, regardless of the year I input.

For example, call_geolocator_latlon(lat = 32.4, lon = -86.5) returns [1] "010010208011015", but call_geolocator_latlon(lat = 32.4, lon = -86.5, vintage = 2010) returns Bad Request (HTTP 400).

I wasn't able to find any examples of specifying the vintage on the internet, so I'm not sure if I'm just using the function incorrectly or if there is a bigger issue. Thanks!

It appears they made quite a few changes to what benchmarks and vintages are available.

for reference:
benchmarks are the version of the Census bureaus master address file that you would like to use to search your addresses
vintages are the version of geographies inside the benchmark that you would like to use to search your addresses

You can get the list of available benchmarks here
https://geocoding.geo.census.gov/geocoder/benchmarks
it appears to be limited to
Public_AR_Current
Public_AR_ACS2022
Public_AR_Census2020

When you do not specify a benchmark in your command the function will automatically use "Public_AR_Current"

You are supposed to be able to get a list of vintages for a benchmark by using this link
https://geocoding.geo.census.gov/geocoder/vintages?benchmark=Public_AR_Current
but it appears to not be populating the vintages.
however when you don't specify a vintage in your command it uses "Current_Current" which should be the latest version of the benchmark.

so using the command without specifying a benchmark or vintage
call_geolocator_latlon(lat = 32.4, lon = -86.5)
will return
[1] "010010208011015"

You can go to this page
https://geocoding.geo.census.gov/geocoder/geographies/coordinates?form
which is the web interface for the API and see the list of available vintages for each corresponding benchmark.

@noararazzak
Copy link

Hi,

Initially, I was using call_geolocator_latlon() from the tigris package in R and kept having issues when I put in the arguments benchmark="Public_AR_Census2010" and vintage="Census2010_Census2010" in the function. Therefore, I switched to using the Python package pygris.

However while implementing the geolookup function from the pygris package, when I use the arguments benchmark="Public_AR_Census2010" and vintage="Census2010_Census2010", the Python console tells me I am using invalid entries for benchmark and vintage. I tried using either the benchmark argument or the vintage argument, but each time I am told I am using invalid entries.

The function works if I do not specify the benchmark or the vintage arguments.

elipousson added a commit to elipousson/tigris that referenced this issue Mar 8, 2024
Adds validation for benchmark and vintage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants