Skip to content

Allow cars on pedestrian ways - #3122

Closed
otbutz wants to merge 6 commits into
graphhopper:masterfrom
otbutz:car_pedestrian
Closed

otbutz wants to merge 6 commits into
graphhopper:masterfrom
otbutz:car_pedestrian

Conversation

@otbutz

@otbutz otbutz commented Feb 18, 2025

Copy link
Copy Markdown
Contributor

Fixes #2888

Allow cars to use pedestrian ways, if they are explicitly tagged as accessible.

@otbutz
otbutz marked this pull request as draft February 18, 2025 16:23
@otbutz
otbutz marked this pull request as ready for review February 19, 2025 09:36
@otbutz

otbutz commented Feb 19, 2025 •

Copy link
Copy Markdown
Contributor Author

Example route: https://graphhopper.com/maps/?point=49.018697%2C12.089594&point=49.019497%2C12.097177&profile=car&layer=OpenStreetMap

Without pedestrian access

Screenshot 2025-02-19 at 10-39-00 GraphHopper Maps Route Planner

With pedestrian access

Screenshot 2025-02-19 at 10-39-24 GraphHopper Maps Route Planner

Google Maps (reference)

Screenshot 2025-02-19 at 10-46-07 Bismarckplatz 93047 Regensburg nach Domplatz 93047 Regensburg - Google Maps

Valhalla (reference)

Link: https://valhalla.openstreetmap.de/directions?profile=car&wps=12.089579701423645%2C49.01870528287077%2C12.097181081771852%2C49.01961293225909

grafik

Most ways in the historic district are tagged with highway=living_street or highway=pedestrian. The signage DE:240 used for some ways adds to that confusion:

grafik

So maybe not the best example, but it works 🙂

public abstract class AbstractAccessParser implements TagParser {
static final Collection<String> ONEWAYS = Arrays.asList("yes", "true", "1", "-1");
static final Collection<String> INTENDED = Arrays.asList("yes", "designated", "official", "permissive");
static final Collection<String> INTENDED = Arrays.asList("yes", "designated", "official", "permissive", "destination");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

destination can generally be considered as accessible and doesn't really matter for non-motorized transportation modes.

if ("pedestrian".equals(highwayValue)) {
// allow access if explicitly tagged
String restriction = way.getFirstValue(restrictionKeys);
if (!intendedValues.contains(restriction)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By using intendedValues we can skip any tagging mistakes like motor_vehicle=asdf

karussell added a commit that referenced this pull request Oct 8, 2025
karussell added a commit that referenced this pull request Oct 8, 2025
* use my branch and #3122

* slightly faster

* test unknown value and conditional with time only (regarding #3168)
@karussell

Copy link
Copy Markdown
Member

Thanks @otbutz for this - implemented with some modifications in #3203.

@karussell karussell closed this Oct 8, 2025
@otbutz
otbutz deleted the car_pedestrian branch October 9, 2025 07:04
chazab pushed a commit to rayanhidri/graphhopper that referenced this pull request Oct 10, 2025
* use my branch and graphhopper#3122

* slightly faster

* test unknown value and conditional with time only (regarding graphhopper#3168)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pedestrian street with vehicles allowed not routable by car profile

2 participants