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

error in route_graphhopper #110

Closed
sckott opened this issue Sep 1, 2016 · 7 comments
Closed

error in route_graphhopper #110

sckott opened this issue Sep 1, 2016 · 7 comments

Comments

@sckott
Copy link
Contributor

sckott commented Sep 1, 2016

With route_graphhopper getting this

route_graphhopper("New York", "Oaxaca", vehicle = "bike")
#> Error in (function (classes, fdef, mtable)  : 
#>   unable to find an inherited method for function ‘coordinates’ for signature ‘"NULL"’

And I do have my graphhopper PAT in my env vars, so I am guessing that's not the problem

<r> session_info()
#> Session info -----
#> setting  value                                      
#>  version  R version 3.3.1 Patched (2016-08-17 r71112)
#>  system   x86_64, darwin13.4.0                       
#>  ui       RStudio (1.0.1)                            
#>  language (EN)                                       
#>  collate  en_US.UTF-8                                
#>  tz       America/Los_Angeles                        
#>  date     2016-09-01                                 
#> 
#> Packages ---------
#> package     * version    date       source                                
#>  assertthat    0.1        2013-12-06 CRAN (R 3.3.0)                        
#>  bitops        1.0-6      2013-08-17 CRAN (R 3.3.0)                        
#>  curl          1.2        2016-08-13 CRAN (R 3.3.1)                        
#>  data.table    1.9.7      2016-08-31 Github (Rdatatable/data.table@c6ed49c)
#>  DBI           0.5        2016-08-12 Github (rstats-db/DBI@1e37697)        
#>  devtools    * 1.12.0     2016-06-24 CRAN (R 3.3.0)                        
#>  digest        0.6.10     2016-08-02 CRAN (R 3.3.1)                        
#>  dplyr         0.5.0.9000 2016-08-30 Github (hadley/dplyr@167b503)         
#>  foreign       0.8-66     2015-08-19 CRAN (R 3.3.1)                        
#>  geosphere     1.5-5      2016-06-15 CRAN (R 3.3.0)                        
#>  htmltools     0.3.5      2016-03-21 CRAN (R 3.3.0)                        
#>  htmlwidgets   0.7        2016-08-02 CRAN (R 3.3.1)                        
#>  httr          1.2.1      2016-07-03 cran (@1.2.1)                         
#>  igraph        1.0.1      2015-06-26 CRAN (R 3.3.0)                        
#>  jsonlite      1.0        2016-07-01 CRAN (R 3.3.1)                        
#>  lattice       0.20-33    2015-07-14 CRAN (R 3.3.1)                        
#>  leaflet     * 1.0.1      2016-02-27 CRAN (R 3.3.0)                        
#>  lubridate     1.5.6      2016-04-06 CRAN (R 3.3.0)                        
#>  magrittr      1.5        2014-11-22 CRAN (R 3.3.0)                        
#>  maptools      0.8-39     2016-01-30 CRAN (R 3.3.0)                        
#>  memoise       1.0.0      2016-01-29 CRAN (R 3.3.0)                        
#>  openxlsx      3.0.0      2015-07-03 CRAN (R 3.3.0)                        
#>  png           0.1-7      2013-12-03 CRAN (R 3.3.0)                        
#>  R.methodsS3   1.7.1      2016-02-16 CRAN (R 3.3.0)                        
#>  R.oo          1.20.0     2016-02-17 CRAN (R 3.3.0)                        
#>  R.utils       2.3.0      2016-04-14 CRAN (R 3.3.0)                        
#>  R6            2.1.3      2016-08-19 cran (@2.1.3)                         
#>  raster        2.5-8      2016-06-02 CRAN (R 3.3.0)                        
#>  Rcpp          0.12.6     2016-07-19 CRAN (R 3.3.1)                        
#>  RCurl         1.95-4.8   2016-03-01 CRAN (R 3.3.0)                        
#>  readr         1.0.0.9000 2016-08-10 local                                 
#>  rgdal         1.1-10     2016-05-12 CRAN (R 3.3.0)                        
#>  rgeos         0.3-19     2016-04-04 CRAN (R 3.3.0)                        
#>  RgoogleMaps   1.2.0.7    2015-01-21 CRAN (R 3.3.0)                        
#>  RJSONIO       1.3-0      2014-07-28 CRAN (R 3.3.0)                        
#>  sp          * 1.2-3      2016-04-14 CRAN (R 3.3.0)                        
#>  stplanr     * 0.1.4      2016-08-29 CRAN (R 3.3.0)                        
#>  stringi       1.1.1      2016-05-27 CRAN (R 3.3.0)                        
#>  stringr       1.1.0      2016-08-19 CRAN (R 3.3.0)                        
#>  tibble        1.2-12     2016-08-30 Github (hadley/tibble@6d2bb08)        
#>  withr         1.0.2      2016-06-21 Github (jimhester/withr@91279ae)   
@richardellison
Copy link
Collaborator

richardellison commented Sep 1, 2016

Does graphhopper_pat() return your API key? If I have an invalid API key I get the same result, but a valid one works. I have added a check to return a more useful error message when the API key is invalid in #112 .

@sckott
Copy link
Contributor Author

sckott commented Sep 1, 2016

It does return my key , I guess I can check if the key is still valid

@richardellison
Copy link
Collaborator

You can try adding silent=FALSE to the route_graphhopper call and then running the request URL and see if that returns a valid result.

@sckott
Copy link
Contributor Author

sckott commented Sep 2, 2016

I'll try that

@sckott
Copy link
Contributor Author

sckott commented Sep 2, 2016

this is erroring b/c when message slot doesn't exist it fails

if (grepl("Wrong credentials", obj$message) == TRUE) {
    stop("Invalid API key")
  }

at these lines: https://github.com/ropensci/stplanr/blob/master/R/routes.R#L213-L215

tried again, with a new API key, which works, but the request fails due to those lines of code above

@richardellison
Copy link
Collaborator

I see that now. Should be fixed in #116.

@sckott
Copy link
Contributor Author

sckott commented Sep 3, 2016

works great, thanks

@sckott sckott closed this as completed Sep 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants