Closed mraross closed 3 years ago
On Jan 28, 2020, Chris Hodgson said:
You can now change the cost of intersection crossings ("Xing") dynamically, here is an example: https://office.refractions.net/~chodgson/gc/ols-demo/?rt=rri&xingCost=0,5,10,1.5
There are 3 size classes, determined by the last value in the following list of RoadClasses and their parameters, in the form: ROAD_CLASS("name", isRouteable, sizeCode) ALLEYWAY("alleyway", true, 1), ARTERIAL_MAJOR("arterial_major", true, 2), ARTERIAL_MINOR("arterial_minor", true, 2), COLLECTOR_MAJOR("collector_major", true, 2), COLLECTOR_MINOR("collector_minor", true, 2), DRIVEWAY("driveway", true, 1), FERRY("ferry", true, 0), FERRY_PASSENGER("ferry_passenger", false, 0), FREEWAY("freeway", true, 3), HIGHWAY_MAJOR("highway_major", true, 3), HIGHWAY_MINOR("highway_minor", true, 3), LANE("lane", true, 1), LOCAL("local", true, 1), PEDESTRIAN_MALL("pedestrian_mall", false, 1), RAMP("ramp", true, 2), RECREATION("recreation", true, 1), RESOURCE("resource", true, 1), RESTRICTED("restricted", true, 1), RUNWAY("runway", false, 0), SERVICE("service", true, 1), STRATA("strata", true, 1), TRAIL("trail", false, 0), TRAIL_RECREATION("trail_recreation", false, 0), WATER_ACCESS("water_access", false, 0), YIELD_LANE("yield_lane", true, 1), UNKNOWN("unknown", false, 1);
This is live on dev server now.
Verified in delivery
Intersection crossing cost is the time it takes to wait at a particular type of impactor (e.g., none, yield, stop sign, traffic light) then cross the intersection. To support this, add the following parameter:
&xingCost=_yield-time,stop-time,light-time, crossing-time-multiplier where yield-time is the time (in seconds) to wait at a yield sign or roundabout stop-time is the time (in seconds) to wait at a stop sign light-time is the time (in seconds) to wait at a traffic light crossing-time-multiplier is a multiplier applied to crossing time based on relative size of streets
If the street you start from is a "bigger" street then the street you are crossing or turning onto, the cost value is divided by the crossing time multiplier
If the street you are on is "smaller" than the one you are crossing/turning onto, the cost is multiplied by the crossing time multiplier
If the streets are similarly sized, the crossing-time-multiplier is not applied and the cost value is used as is.
Here is an example crossing cost parameter value that specifies 2 seconds yield-time, 4 seconds, stop-time, 6 seconds light-time, and a crossing-time-multiplier of 1.5