ggmap icon indicating copy to clipboard operation
ggmap copied to clipboard

Return the variable "query" to the output of the geocode function.

Open hydrosIII opened this issue 8 years ago • 0 comments

Hi, i was using the geocode function and using the variable query to do some joins and comparison. The new version of geocode since 2015 just dumps this variable and substitutes the variable with the address given by google, thus losing some information.

This feature was useful, since it is easy to get the info out, here is an example of use of the query variable, to do a join:

locs <- geocode(as.character(unique(db$name)), output = "more")

db <- left_join(db1, locs[,c("lon", "lat", "query")], 
                     by = c("name" = "query"))

In this example, the colum "query" was used to join the results in the output of geocode, since 2015 geocode when using google maps corrects the location if you input not so exact information, but some information is lost since it gives info given by google as output.

Rereading the code for geocode i figured out that using the dsk option, you can retrieve the information lost, but only if you use this option. Is it so difficult to renable the query variable to output the original string?

hydrosIII avatar Dec 16 '16 07:12 hydrosIII