diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 0a02565..1a997e5 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,8 +61,9 @@ jobs: if: runner.os == 'macOS' run: | # conflicts with gfortran from r-lib/actions when linking gcc - rm '/usr/local/bin/gfortran' - brew install pkg-config gdal proj geos + # rm '/usr/local/bin/gfortran' # Now Failing + # brew install pkg-config gdal proj geos + brew install gdal proj - name: Query dependencies run: | diff --git a/NEWS.md b/NEWS.md index a068856..f4ac026 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,8 @@ * Fixed bug in `otp_isochrone` when using `fromID` * Slightly faster routing with large batches -* More mode choices in `otp_plan` +* More mode choices in `otp_plan` and `otp_isochrone` + # opentripplanner 0.5.1 diff --git a/R/otp-isochrone-batch.R b/R/otp-isochrone-batch.R index 49060f5..1a94aae 100644 --- a/R/otp-isochrone-batch.R +++ b/R/otp-isochrone-batch.R @@ -7,8 +7,9 @@ #' data frame of POINTS #' @param fromID character vector same length as fromPlace #' @param mode character vector of one or more modes of travel valid values -#' TRANSIT, WALK, BICYCLE, CAR, BUS, RAIL, SUBWAY, TRAM, FERRY, BICYCLE_RENT, -#' BICYCLE_PARK, CAR_PARK, CABLE_CAR, GONDOLA, FUNICULAR, AIRPLANE, default +#' "TRANSIT","BUS", "RAIL", "SUBWAY","TRAM", "FERRY", "GONDOLA", "FUNICULAR", +#' "AIRPLANE", "CABLE_CAR", "WALK", "BICYCLE", "BICYCLE_RENT", "BICYCLE_PARK", +#' "CAR", "CAR_PARK", "CAR_HAIL", "CARPOOL", "CAR_DROPOFF", "CAR_PICKUP", default #' CAR. Not all combinations are valid e.g. c("WALK","BUS") is valid but #' c("WALK","CAR") is not. #' @param date_time POSIXct, a date and time, defaults to current @@ -73,11 +74,12 @@ otp_isochrone <- function(otpcon = NA, mode <- toupper(mode) checkmate::assert_subset(mode, choices = c( - "TRANSIT", "WALK", "BICYCLE", - "CAR", "BUS", "RAIL", "SUBWAY", - "TRAM", "FERRY","BICYCLE_RENT", - "BICYCLE_PARK","CAR_PARK","CABLE_CAR", - "GONDOLA","FUNICULAR","AIRPLANE" + "TRANSIT","BUS", "RAIL", "SUBWAY","TRAM", "FERRY", + "GONDOLA","FUNICULAR","AIRPLANE","CABLE_CAR", + "WALK", + "BICYCLE","BICYCLE_RENT","BICYCLE_PARK", + "CAR","CAR_PARK", + "CAR_HAIL","CARPOOL","CAR_DROPOFF","CAR_PICKUP" ), empty.ok = FALSE ) diff --git a/R/otp-setup.R b/R/otp-setup.R index cbd758f..f6d80a5 100644 --- a/R/otp-setup.R +++ b/R/otp-setup.R @@ -497,6 +497,18 @@ otp_checks <- function(otp = NULL, } else { return(FALSE) } + + if(otp_version >= 2){ + fls_zip <- list.files(file.path(dir, "/graphs/", router), pattern = ".zip") + if(length(fls_zip) > 0){ + if(any(!grepl("gtfs",fls_zip))){ + warning(".zip files detected that are not .gtfs.zip, OTP 2.X will ignore these files") + } + } + } + + + } diff --git a/man/otp_isochrone.Rd b/man/otp_isochrone.Rd index 4e60526..8a65cd9 100644 --- a/man/otp_isochrone.Rd +++ b/man/otp_isochrone.Rd @@ -29,8 +29,9 @@ or 2 column matrix of Longitude/Latitude pairs, or sf \item{fromID}{character vector same length as fromPlace} \item{mode}{character vector of one or more modes of travel valid values -TRANSIT, WALK, BICYCLE, CAR, BUS, RAIL, SUBWAY, TRAM, FERRY, BICYCLE_RENT, -BICYCLE_PARK, CAR_PARK, CABLE_CAR, GONDOLA, FUNICULAR, AIRPLANE, default +"TRANSIT","BUS", "RAIL", "SUBWAY","TRAM", "FERRY", "GONDOLA", "FUNICULAR", +"AIRPLANE", "CABLE_CAR", "WALK", "BICYCLE", "BICYCLE_RENT", "BICYCLE_PARK", +"CAR", "CAR_PARK", "CAR_HAIL", "CARPOOL", "CAR_DROPOFF", "CAR_PICKUP", default CAR. Not all combinations are valid e.g. c("WALK","BUS") is valid but c("WALK","CAR") is not.} diff --git a/man/otp_plan.Rd b/man/otp_plan.Rd index 5a64c9e..152b026 100644 --- a/man/otp_plan.Rd +++ b/man/otp_plan.Rd @@ -40,9 +40,10 @@ or sf data frame of POINTS with CRS 4326} \item{toID}{character vector same length as toPlace} \item{mode}{character vector of one or more modes of travel valid values -TRANSIT, WALK, BICYCLE, CAR, BUS, RAIL, SUBWAY, TRAM, FERRY, BICYCLE_RENT, -BICYCLE_PARK, CAR_PARK, CABLE_CAR, GONDOLA, FUNICULAR, AIRPLANE, default -CAR. Not all combinations are valid e.g. c("WALK","BUS") is valid but +"TRANSIT","BUS", "RAIL", "SUBWAY","TRAM", "FERRY", "GONDOLA", "FUNICULAR", +"AIRPLANE", "CABLE_CAR", "WALK", "BICYCLE", "BICYCLE_RENT", "BICYCLE_PARK", +"CAR", "CAR_PARK", "CAR_HAIL", "CARPOOL", "CAR_DROPOFF", "CAR_PICKUP", +default "CAR". Not all combinations are valid e.g. c("WALK","BUS") is valid but c("WALK","CAR") is not.} \item{date_time}{POSIXct, a date and time, defaults to current date and time} diff --git a/man/otp_surface_isochrone.Rd b/man/otp_surface_isochrone.Rd index 396ce47..6ad5b65 100644 --- a/man/otp_surface_isochrone.Rd +++ b/man/otp_surface_isochrone.Rd @@ -9,7 +9,7 @@ otp_surface_isochrone(otpcon = NULL, surface = NULL) \arguments{ \item{otpcon}{OTP connection object produced by otp_connect()} -\item{surface}{A suface list from otp_make_surface()} +\item{surface}{A surface list from otp_make_surface()} } \value{ Returns a data.frame of travel times diff --git a/tests/testthat/test_02_without_OTP.R b/tests/testthat/test_02_without_OTP.R index 30cf1e6..636dfbf 100644 --- a/tests/testthat/test_02_without_OTP.R +++ b/tests/testthat/test_02_without_OTP.R @@ -196,7 +196,7 @@ test_that("otp_isochrone input validation", { ) skip_on_cran() expect_error(otp_isochrone(otpcon, fromPlace = c(1, 1)), - regexp = "No results returned, check your connection" + regexp = "No results returned, check your connection|Failed to connect to localhost" ) }) diff --git a/tests/testthat/test_03_with_OTP.R b/tests/testthat/test_03_with_OTP.R index b751506..a941241 100644 --- a/tests/testthat/test_03_with_OTP.R +++ b/tests/testthat/test_03_with_OTP.R @@ -199,7 +199,7 @@ test_that("transit routing", { route <- otp_plan(otpcon, fromPlace = c(-1.16489, 50.64990), toPlace = c(-1.15803, 50.72515), - date_time = as.POSIXct(strptime("2022-06-03 13:30", "%Y-%m-%d %H:%M")), + date_time = as.POSIXct(strptime("2024-06-03 13:30", "%Y-%m-%d %H:%M")), mode = c("WALK", "TRANSIT"), numItineraries = 3 ) diff --git a/vignettes/OTPv2.Rmd b/vignettes/OTPv2.Rmd index 3da249c..626b1d8 100644 --- a/vignettes/OTPv2.Rmd +++ b/vignettes/OTPv2.Rmd @@ -40,9 +40,9 @@ It is possible to install multiple version of Java on the same computer: **Download Links** -* [Java 8](https://www.java.com/en/download/manual.jsp) -* [Java 11](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) -* [Java 17](https://www.oracle.com/java/technologies/downloads/#java17) +* [Java 8](https://www.java.com/en/download/) +* [Java 11](https://www.oracle.com/uk/java/technologies/javase/jdk11-archive-downloads.html) +* [Java 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) If you have multiple version of Java installed you will also need to change the PATH variable to point to the correct version of Java. You can check your current default version of Java in the terminal using diff --git a/vignettes/opentripplanner.Rmd b/vignettes/opentripplanner.Rmd index 41cd0c4..20db0f6 100644 --- a/vignettes/opentripplanner.Rmd +++ b/vignettes/opentripplanner.Rmd @@ -233,7 +233,7 @@ OTP can use public transport timetable data in the [GTFS format](https://develop #### Elevation Data -You can add terrain information to your routes, especially useful for walking and cycling, using [GeoTIFF images](https://trac.osgeo.org/geotiff). You can find worldwide elevation data from [NASA](https://www2.jpl.nasa.gov/srtm/). +You can add terrain information to your routes, especially useful for walking and cycling, using [GeoTIFF images](https://trac.osgeo.org/geotiff). You can find worldwide elevation data from [NASA](https://www.usgs.gov/centers/eros/science/usgs-eros-archive-digital-elevation-shuttle-radar-topography-mission-srtm-non#overview). **Warning** It is common for GeoTIFF to have a no data value often the maximum possible value. OTP can misinterpret this as an elevation value. So set your no data values in your elevation data to something more plausible like 0. diff --git a/vignettes/prerequisites.Rmd b/vignettes/prerequisites.Rmd index db48cbc..43e6a23 100644 --- a/vignettes/prerequisites.Rmd +++ b/vignettes/prerequisites.Rmd @@ -25,7 +25,7 @@ This package allows you to use the trip planning power of OTP with the analytica The `opentripplanner` R package makes it easier for R and OpenTripPlanner to communicate. Specifically, it allows you to do use R to control OTP and use it as a local routing service. -For more on local versus remote routing services, see the Transportation chapter in [Geocomputation with R](https://geocompr.robinlovelace.net/transport.html). +For more on local versus remote routing services, see the Transportation chapter in [Geocomputation with R](https://r.geocompx.org/transport.html). ### What are R and RStudio? @@ -37,7 +37,7 @@ An R package is a small piece of software that extends the basic capabilities of ### Help with R -To get started with R, see [An Introduction to R](https://cran.r-project.org/doc/manuals/r-release/R-intro.pdf) or from within R by running `help.start()`, introductory tutorials such as DataCamp's free Introduction to R course, or the [R tutor website](https://www.r-tutor.com/r-introduction). The [Geocomputation with R](https://geocompr.robinlovelace.net) book covers the packages and skills required to analyse spatial datasets such as those produced by OpenTripPlanner. +To get started with R, see [An Introduction to R](https://cran.r-project.org/doc/manuals/r-release/R-intro.pdf) or from within R by running `help.start()`, introductory tutorials such as DataCamp's free Introduction to R course, or the [R tutor website](https://www.r-tutor.com/r-introduction). The [Geocomputation with R](https://r.geocompx.org/) book covers the packages and skills required to analyse spatial datasets such as those produced by OpenTripPlanner. A video tutorial for installing R and RStudio @@ -103,7 +103,7 @@ The package includes a simple function for checking if you have the correct vers To get Java: -* **Windows/Mac** https://www.java.com/en/download/ This link defaults to the 32 Bit version, so also check https://java.com/en/download/manual.jsp. +* **Windows/Mac** https://www.java.com/en/download/ This link defaults to the 32 Bit version, so also check https://www.java.com/en/download/help/java_win64bit.html. * **Linux** we recommend instructions at [StackOverflow](https://askubuntu.com/questions/740757/switch-between-multiple-java-versions).