-
Notifications
You must be signed in to change notification settings - Fork 21
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
Include more detail in ArcGIS results when full_results=TRUE #177
Comments
Hi @ottothecow, thanks for pointing this out. If you look in the API parameters table on the geocoding services page you can see which parameters have default values specified for each service. Currently, with the exception of the US Census service, the only default values being passed are to specify JSON format. Are there any downsides to adding At the very least, it would be good to add a note on this in the documentation. I just want to make sure adding a default value for a parameter like this doesn't create other complications. |
I'm not seeing a noticeable difference in time. I drew a random sample of 50 addresses and ran them through each method 5 times: mbm = microbenchmark(
custom = samp %>% geocode(address=full_addr,
verbose=TRUE,
method='arcgis',
full_results=TRUE,
custom_query=list(outFields='*')),
default = samp %>% geocode(address=full_addr,
verbose=TRUE,
method='arcgis',
full_results=TRUE),
times=5
)
I'd note that on a prior run of 25 addresses over 3 repetitions, the default was marginally faster so I'm not interpreting anything from the fact that the Given I'm not seeing a difference in speed I don't necessarily see a harm in adding it as a default. It does roughly triple the size of the resulting dataframe (and similarly increases network overhead), but I assume most users of tidygeocoder aren't using it in real time applications or overly concerned with memory usage. There's always the risk that adding columns could break someone's code, but I would hope most users aren't writing programs that are susceptible to that--especially when using external APIs that can change. A note in the documentation seems OK too--just needs to be clear that there's more potential information available. In my mind the crucial piece of missing information is the attributes.Addr_type variable as I typically don't want to rely upon any geocodes that don't match 'PointAddress' or 'StreetAddress' and will instead attempt to run them through another API. Also, perhaps it should be a separate feature request, but now that I am looking at the ArcGIS documentation, it looks like it does allow specifying address components. I did a quick test with the following modifications to api_parameter_reference.R: ########################### ArcGis #################################
# ArcGis may not require an api key
"arcgis", "address", "SingleLine", NA, FALSE,
"arcgis", "street", "address", NA, FALSE,
"arcgis", "city", "city", NA, FALSE,
"arcgis", "state", "region", NA, FALSE,
"arcgis", "postalcode", "postal", NA, FALSE,
"arcgis", "country", "countryCode", NA, FALSE,
"arcgis", "limit", "maxLocations", "1", FALSE,
"arcgis", "format", "f", "json", TRUE,
"arcgis", "outFields", "outFields", "*",TRUE, It seems to work both for including the extra fields and for geocoding using address components rather than single-line. Overriding this is possibly by adding |
Good catch RE the ArcGIS address component parameters. I created a separate issue for that feature here: #180 |
@ottothecow I went ahead and made |
@jessecambon you can go ahead and list it as Otto Hansen. Thanks! |
@ottothecow no problem. Also, let me know if you have an email and/or ORCID you want me to add. |
@jessecambon and since you asked, I went ahead and created an ORCID: https://orcid.org/0000-0002-4618-5667 |
I noticed that the results for the ArcGIS geocoder felt a little "light" when
full_results=TRUE
is set.In particular, it doesn't provide any indication of what type of match has been found. It has a 'score' variable, but there's no way to know if a score refers to a good point address match or to a match to a city center.
I did some digging in their API documentation and saw that in order to capture FULL address detail, you need to set
outfields=*
which will more detailed fields rather than just the default.I can get this in my own code by setting somethign like this:
But I would vote that
outfields=*
be automatically set whenfull_results=TRUE
as this brings it inline with the level of detail provided by other geocoders when asking for full results.The text was updated successfully, but these errors were encountered: