tigris icon indicating copy to clipboard operation
tigris copied to clipboard

Trouble specifying vintage with call_geolocator_latlon()

Open bencarey86 opened this issue 2 years ago • 3 comments

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 avatar Oct 28 '22 02:10 bencarey86

@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")

walkerke avatar Dec 05 '22 16:12 walkerke

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.

dteck avatar Dec 05 '22 17:12 dteck

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.

noararazzak avatar Sep 25 '23 17:09 noararazzak