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

Errors for osrmTrip #30

Closed
HunnicuttP opened this issue Feb 23, 2018 · 3 comments
Closed

Errors for osrmTrip #30

HunnicuttP opened this issue Feb 23, 2018 · 3 comments

Comments

@HunnicuttP
Copy link

HunnicuttP commented Feb 23, 2018

Hello,

When running osrmTrip, I am receiving two errors that I am having difficulty interpreting.

The first is:
"OSRM returned an error:
Error: "

The second is:
"OSRM returned an error:
Error: Unable to parse: GEOMETRYCOLLECTION(LINESTRING"...(followed by coordinate pairs)
"GEOS reported: "IllegalArgumentException: point array must contain 0 or >1 elements"

Any help interpreting these errors would be much appreciated.

@rCarto
Copy link
Member

rCarto commented Feb 23, 2018

Can you provide a reproducible example leading to this error + the output of sessionInfo() please?

@HunnicuttP
Copy link
Author

HunnicuttP commented Feb 23, 2018

Data is attached.
replication_PH.csv.zip

The following should produce the blank error:
df <- read.csv([data))
trip <- osrmTrip(df[c(81:306),])

The following should produce the "unable to parse" error:
df <- read.csv(data)
trip <- osrmTrip(df[c(1:80),])

Output from session info:
`sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.13.3 (unknown)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] stringr_1.2.0 osrm_3.1.0 rgdal_1.1-10 sp_1.2-7 dplyr_0.7.4 plyr_1.8.4

loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 lattice_0.20-35 assertthat_0.2.0 bitops_1.0-6 grid_3.3.1 R6_2.2.2 jsonlite_1.5 magrittr_1.5 stringi_1.1.5 rlang_0.1.2 bindrcpp_0.2 tools_3.3.1 glue_1.1.1 RCurl_1.95-4.10
[15] pkgconfig_2.0.1 rgeos_0.3-26 bindr_0.1 tibble_1.3.4`

Many thanks.

@rCarto
Copy link
Member

rCarto commented Mar 5, 2018

Sorry for the late reply.
The "blank error" is due to the fact that the public OSRM API does not allow trips with more than 100 locations. I've just added a more informative message. To use more than 100 locations you could use your own instance of OSRM and set the --max-trip-size option to a higher value.

The "unable to parse" error was due to a bug in the package. The bug is corrected and the current dev version should work (use devtools::install_github("rCarto/osrm")

@rCarto rCarto closed this as completed in bb7d775 Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants