Created
February 10, 2026 13:01
-
-
Save szechno/d2fa5740bf11e7fbbd024a8f5df8c24a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Improvements: | |
| # add `mode` to get_routes by filtering available highway = * | |
| # 'footway', 'unclassified','service', 'track', 'bridleway', 'path', | |
| # 'residential', 'tertiary', 'primary', 'trunk', 'secondary', 'motorway', | |
| # 'tertiary_link', 'pedestrian', 'cycleway', 'primary_link', 'motorway_link', | |
| # 'trunk_link', 'secondary_link', 'living_street', 'construction', 'services', | |
| # 'proposed', 'busway', 'crossing' | |
| # mode == 'walking' | |
| # not 'motorway', 'motorway_link', 'busway', 'cycleway', 'construction', | |
| # 'services' | |
| route_roads <- school_roads |> activate("edges") |> filter(highway %in% c( | |
| 'footway', 'unclassified','service', 'track', 'bridleway', 'path', | |
| 'residential', 'tertiary', 'primary', 'trunk', 'secondary', | |
| 'tertiary_link', 'pedestrian', 'primary_link', 'trunk_link', 'secondary_link', | |
| 'living_street', 'proposed', 'crossing' | |
| )) | |
| # mode == 'cycling' | |
| # not 'motorway', 'motorway_link', 'busway', 'construction', 'services' | |
| route_roads <- school_roads |> activate("edges") |> filter(highway %in% c( | |
| 'footway', 'unclassified','service', 'track', 'bridleway', 'path', | |
| 'residential', 'tertiary', 'primary', 'trunk', 'secondary', 'tertiary_link', | |
| 'pedestrian', 'cycleway', 'primary_link', 'trunk_link', 'secondary_link', | |
| 'living_street', 'proposed', 'crossing' | |
| )) | |
| # mode == 'car' | |
| # 'footway', 'track', 'bridleway', 'path', 'pedestrian', 'cycleway', 'busway', | |
| # 'crossing', 'construction' | |
| route_roads <- school_roads |> activate("edges") |> filter(highway %in% c( | |
| 'unclassified','service', 'residential', 'tertiary', 'primary', 'trunk', | |
| 'secondary', 'motorway', 'tertiary_link', 'primary_link', 'motorway_link', | |
| 'trunk_link', 'secondary_link', 'living_street', 'services', | |
| 'proposed', | |
| )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment