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

Don't pass NA to geocoding API #30

Closed
petrbouchal opened this issue Mar 2, 2021 · 3 comments
Closed

Don't pass NA to geocoding API #30

petrbouchal opened this issue Mar 2, 2021 · 3 comments
Assignees
Labels

Comments

@petrbouchal
Copy link

If passed NA, geocode() returns a whole lot of places containing "na". I suppose it should return the same value as when the geocoder cannot resolve the address.

RCzechia::geocode(NA)
#> Simple feature collection with 15 features and 3 fields
#> Attribute-geometry relationship: 3 constant, 0 aggregate, 0 identity
#> geometry type:  POINT
#> dimension:      XY
#> bbox:           xmin: 14.03854 ymin: 49.19021 xmax: 17.58948 ymax: 50.73654
#> geographic CRS: WGS 84
#> First 10 features:
#>    target                       typ             address
#> 1      NA                     Okres              Náchod
#> 2      NA                     Okres      Ústí nad Labem
#> 3      NA                     Okres     Ústí nad Orlicí
#> 4      NA                     Okres    Žďár nad Sázavou
#> 5      NA                     Okres Rychnov nad Kněžnou
#> 6      NA                     Okres  Jablonec nad Nisou
#> 7      NA ObecSRozsirenouPusobnosti  Náměšť nad Oslavou
#> 8      NA ObecSRozsirenouPusobnosti              Náchod
#> 9      NA ObecSRozsirenouPusobnosti     Týn nad Vltavou
#> 10     NA ObecSRozsirenouPusobnosti      Lysá nad Labem
#>                     geometry
#> 1  POINT (16.14594 50.47397)
#> 2  POINT (14.03854 50.68511)
#> 3  POINT (16.47523 49.99403)
#> 4   POINT (16.0744 49.49913)
#> 5  POINT (16.26267 50.20638)
#> 6  POINT (15.25925 50.73654)
#> 7  POINT (16.16105 49.19021)
#> 8  POINT (16.14594 50.46277)
#> 9   POINT (14.4418 49.21263)
#> 10  POINT (14.8514 50.19134)

Created on 2021-03-02 by the reprex package (v0.3.0)

@jlacko jlacko self-assigned this Mar 2, 2021
@jlacko jlacko added the bug label Mar 2, 2021
@jlacko
Copy link
Owner

jlacko commented Mar 2, 2021

This would be funny if it were not serious... Thank you, it will be corrected. Likely via a is.na() testing of input vector.
Thanks for raising the issue!

@petrbouchal
Copy link
Author

Well at least Namibia isn't involved gshs-ornl/wbstats#26

@jlacko jlacko closed this as completed in 198d54e Mar 2, 2021
@jlacko
Copy link
Owner

jlacko commented Mar 3, 2021

I heard good stories about Norway (ISO code "NO", evaluating as logical FALSE) in this context as well :)

v1.6.7 is on its way to CRAN - I had some issues with not-quite-graceful fail of unavailable internet resources & a brush with CRAN policy, so the timing was in a way fortunate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants