Skip to content

Commit

Permalink
Fix #109
Browse files Browse the repository at this point in the history
  • Loading branch information
mem48 committed Oct 25, 2023
1 parent 0f023b6 commit 0ff016d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions R/otp-surface.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ otp_surface <- function(otpcon = NULL,
message(Sys.time()," evaluating ",length(surfaceUrl)," surfaces using ",ncores," threads")
results <- progressr::with_progress(otp_async(surfaceUrl, ncores))

asjson <- RcppSimdJson::fparse(unlist(results, use.names = FALSE), parse_error_ok = TRUE)
asjson <- RcppSimdJson::fparse(unlist(results, use.names = FALSE),
parse_error_ok = TRUE,
always_list = TRUE)

res <- purrr::map(asjson, parse_surface, get_data = get_data)
return(res)
x = return(res)

}

Expand Down Expand Up @@ -232,7 +234,8 @@ otp_make_surface <- function(otpcon = NULL,

# convert response content into text
asjson <- RcppSimdJson::fparse(unlist(results, use.names = FALSE),
parse_error_ok = TRUE)
parse_error_ok = TRUE,
always_list = TRUE)

return(asjson)

Expand Down
2 changes: 1 addition & 1 deletion vignettes/Analyst.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ttimes <- otp_surface(otpcon, surfaceid, "lsoa", get_data = FALSE)
We can visualise the travel times using the `tmap` package.

```{r eval=FALSE}
lsoa$time <- ttimes$times / 60
lsoa$time <- ttimes[[1]]$times / 60
library(tmap)
tmap_mode("view")
tm_shape(lsoa) +
Expand Down

0 comments on commit 0ff016d

Please sign in to comment.