The following analysis is based on 10 random locations for which 1 hour isochrones split in 20 min ranges were requested.

Distribution of edge lengths

Percentage of edges to be split (y-axis) as function of edge length (x-axis).

distances <- read.csv("distances.txt")[,1]

f <- function(x) sum(distances > x) / length(distances) * 100

x = c(20, seq(50, 1000, 50))
y = sapply(x, f)

plot(x, y, xlab = "edge length [m]", ylab = "% of splitted edges")

Benchmark data import

library("openrouteservice")
setwd("~/Projects/benchmarks/isochrones")

load("isochrones_split_20m.rda")
split_20m <- results

load("isochrones_split_none.rda")
split_none <- results

load("isochrones_split_200m.rda")
split_200m <- results

Performance comparison

query_times_split_20m = sapply(split_20m, function (isochrone) median(attr(isochrone, "query_time")))
query_times_split_none = sapply(split_none, function (isochrone) median(attr(isochrone, "query_time")))
query_times_split_200m = sapply(split_200m, function (isochrone) median(attr(isochrone, "query_time")))

maxtime = max(query_times_split_20m, query_times_split_none, query_times_split_200m)

plot (query_times_split_20m, query_times_split_none, xlim = c(0, maxtime), ylim = c(0, maxtime), yaxs = "i",
      main = "query times [s]", xlab = "20m splitting", ylab = "no splitting (black) and 200m splitting (blue)")
points (query_times_split_20m, query_times_split_200m, col = "blue")
abline(0,1, col = "red")

Differences in isochrone geometries

  • Red: no split
  • Green: split 200m
  • Blue: split 20m
library(leaflet)
library(htmltools)
html <- list()

for (id in seq_along(split_20m)) {
  ref <- split_20m[[id]]
  leaflet(height = 800) %>%
    addTiles() %>%
    fitBBox(ref$bbox) %>%
    addGeoJSON(ref, color = c("#00f")) %>%
    addGeoJSON(split_200m[[id]], color = c("#0f0")) %>%
    addGeoJSON(split_none[[id]], color = c("#f00")) -> widget
  
  html <- c(html, list(h2(paste0("Location #", id)), widget))
}
tagList(html)

Location #1

Location #2

Location #3

Location #4

Location #5

Location #6

Location #7

Location #8

Location #9

Location #10

Detailed comparison for the most prominent example

No split (red) vs. split 20m (blue):

id <- 7
ref <- split_20m[[id]]

  leaflet(height = 800) %>%
    addTiles() %>%
    fitBBox(ref$bbox) %>%
    addGeoJSON(ref$features[[3]], color = c("#00f")) %>%
    addGeoJSON(split_none[[id]]$features[[3]], color = c("#f00")) 

Split 200m (red) vs. split 20m (blue):

  leaflet(height = 800) %>%
    addTiles() %>%
    fitBBox(ref$bbox) %>%
    addGeoJSON(ref$features[[3]], color = c("#00f")) %>%
    addGeoJSON(split_200m[[id]]$features[[3]], color = c("#f00"))