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

geocode() misaligns results when limit > 1 #88

Closed
jessecambon opened this issue Mar 19, 2021 · 1 comment
Closed

geocode() misaligns results when limit > 1 #88

jessecambon opened this issue Mar 19, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@jessecambon
Copy link
Owner

Since results and addresses are combined with cbind(), limit > 1 can cause addresses to be misaligned to results when using geocode().

In this example, address is from the input dataset whiledisplay_name is from the geocoder results:

library(tidygeocoder)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
tibble(address = c('Tokyo', 'Paris', 'Rome')) %>%
  geocode(address, method = 'osm', limit = 3, full_results = TRUE) %>%
  select(address, display_name)
#>   address                                                        display_name
#> 1   Tokyo                                                        東京都, 日本
#> 2   Paris 東京, 鍛冶橋通り, 丸の内2, 丸の内, 千代田区, 東京都, 100-0005, 日本
#> 3    Rome             東京, 丸の内1, 丸の内, 千代田区, 東京都, 100-0005, 日本
#> 4   Tokyo                 Paris, Île-de-France, France métropolitaine, France
#> 5   Paris                 Paris, Île-de-France, France métropolitaine, France
#> 6    Rome                    Paris, Lamar County, Texas, 75460, United States
#> 7   Tokyo                                  Roma, Roma Capitale, Lazio, Italia
#> 8   Paris   Rome, City of Rome, Oneida County, New York, 13440, United States
#> 9    Rome                          Rome, Floyd County, Georgia, United States

Created on 2021-03-18 by the reprex package (v1.0.0)

@jessecambon
Copy link
Owner Author

Addressed in v1.0.3. limit != 1 is now only allowed with return_input = FALSE in geocode() and reverse_geocode().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant