Skip to content

Instantly share code, notes, and snippets.

View aoles's full-sized avatar

Andrzej K. Oleś aoles

View GitHub Profile
@aoles
aoles / weightings.R
Created November 24, 2020 10:07
Priority weightings compared
PRIORITY_CODE = c(
WORST = 0,
AVOID_AT_ALL_COSTS = 1,
REACH_DEST = 2,
AVOID_IF_POSSIBLE = 3,
UNCHANGED = 4,
PREFER = 5,
VERY_NICE = 6,
BEST = 7
)
@aoles
aoles / barrier_access_taginfo.R
Created October 7, 2021 10:02
Query taginfo for barrier access values unknown to ORS
library(jsonlite)
# retrieve all possible node access values which come up at least 10 times
url <- "https://taginfo.openstreetmap.org/api/4/key/values?key=%s&filter=nodes&sortname=count&sortorder=desc&qtype=value&format=json_pretty"
key <- "access"
res <- fromJSON(sprintf(url, key))
df <- res[["data"]]
# filter out combined and rare values