-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #948 from conveyal/dev
v7.3 Release
- Loading branch information
Showing
13 changed files
with
244 additions
and
181 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
35 changes: 35 additions & 0 deletions
35
src/main/java/com/conveyal/r5/labeling/SidewalkTraversalPermissionLabeler.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.conveyal.r5.labeling; | ||
|
||
import com.conveyal.osmlib.Way; | ||
import com.conveyal.r5.streets.EdgeStore; | ||
|
||
/** | ||
* Traversal permission labeler that restricts walking on most driving ways (useful for networks with complete | ||
* sidewalks). Also includes permissions for the United States (see USTraversalPermissionLabeler). | ||
*/ | ||
public class SidewalkTraversalPermissionLabeler extends TraversalPermissionLabeler { | ||
static { | ||
addPermissions("pedestrian", "bicycle=yes"); | ||
addPermissions("bridleway", "bicycle=yes;foot=yes"); //horse=yes but we don't support horse | ||
addPermissions("cycleway", "bicycle=yes;foot=yes"); | ||
addPermissions("trunk|primary|secondary|tertiary|unclassified|residential|living_street|road|service|track", | ||
"access=yes"); | ||
} | ||
|
||
@Override | ||
public RoadPermission getPermissions(Way way) { | ||
RoadPermission rp = super.getPermissions(way); | ||
if (rp.forward.contains(EdgeStore.EdgeFlag.ALLOWS_CAR) || | ||
rp.forward.contains(EdgeStore.EdgeFlag.NO_THRU_TRAFFIC_CAR) || | ||
rp.backward.contains(EdgeStore.EdgeFlag.ALLOWS_CAR) || | ||
rp.backward.contains(EdgeStore.EdgeFlag.NO_THRU_TRAFFIC_CAR) | ||
) { | ||
rp.forward.remove(EdgeStore.EdgeFlag.ALLOWS_PEDESTRIAN); | ||
rp.forward.remove(EdgeStore.EdgeFlag.NO_THRU_TRAFFIC_PEDESTRIAN); | ||
rp.backward.remove(EdgeStore.EdgeFlag.ALLOWS_PEDESTRIAN); | ||
rp.backward.remove(EdgeStore.EdgeFlag.NO_THRU_TRAFFIC_PEDESTRIAN); | ||
} | ||
return rp; | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
Oops, something went wrong.