Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
2b24881
Added flex street matching
dbenoff Feb 11, 2017
6fcb2f7
Simple flex bus case with no transfers working
dbenoff Feb 11, 2017
cd2fd80
Get continuous pickups/dropoffs into OTP data model
sdjacobs Feb 13, 2017
386fbb3
added temporary edges
dbenoff Feb 16, 2017
2d7dda1
Fix timing for flex transfers and get it to work for stop->hop transfers
sdjacobs Feb 17, 2017
adfe204
flex routing works!
dbenoff Feb 19, 2017
b23c195
flex routing works!
dbenoff Feb 20, 2017
d02e969
flex routing works!
dbenoff Feb 21, 2017
c51284d
hop-to-hop transfers
sdjacobs Feb 21, 2017
ab4eba4
reverse optimizing works
dbenoff Mar 7, 2017
d0c503a
Merged in flex direct transfer work
dbenoff Mar 7, 2017
d3c3e9c
Revert "Merged in flex direct transfer work"
sdjacobs Mar 8, 2017
71f81e6
Merge branch 'sj-flex-dev-2' into db-flex-dev-3
sdjacobs Mar 8, 2017
b69d79c
Merged in flex direct transfer work
dbenoff Mar 10, 2017
31ae808
added logic to handle origins/destinations that lie right on flag sto…
dbenoff May 1, 2017
f41e94b
fixed temporary pattern hop geography trimming.
dbenoff May 6, 2017
cd3784b
remove redundant flex transit classes
sdjacobs Jun 1, 2017
b323a12
quiet logging
sdjacobs Jun 1, 2017
38b510c
avoid vertex name collisions
sdjacobs Jun 1, 2017
286827d
in progress, switch to temp partial hop
sdjacobs Jun 13, 2017
50c826b
fix geometry for partial pattern hops
sdjacobs Jun 14, 2017
6c4b5fd
allow hops to decide they are trivial
sdjacobs Jun 15, 2017
448e994
some refactoring of partial hops, and allow flag stop for street edge…
sdjacobs Jun 16, 2017
c8e9ee2
fix bug with arriveBy=true searches
sdjacobs Jun 16, 2017
2482097
Add penalty for flag stop boardings, so they can co-exist with "real"…
sdjacobs Jun 21, 2017
158d829
Bugfix: if street edge is very long, traverse method kills walk budge…
sdjacobs Jun 21, 2017
bbc8d47
VGF-24 ensure temporary edges/vertices are really temporary
sdjacobs Jun 22, 2017
869b83c
VGF-25 fix IBH so arrive-by new vertices get put in transit queue
sdjacobs Jun 23, 2017
4300b7e
fix duplicates in index
sdjacobs Jun 23, 2017
ee876dc
temporary flag stop service
sdjacobs Jun 23, 2017
2858390
add nearby flag stops to temp service
sdjacobs Jun 23, 2017
9c2587f
Refactoring - move FlagStopSplitterService code into FlagStopCreation…
sdjacobs Jun 23, 2017
0c99c8a
Move creation of temporary edges outside search
sdjacobs Jun 25, 2017
83b5946
Fix State.optimize() issue by adding a fudge factor to time lookup.
sdjacobs Jun 25, 2017
03ca5b6
Check whether PatternHops have flag stop service. Only build flex tra…
sdjacobs Jun 27, 2017
d4d8b41
Change continuous pickup/dropoff to continuous stops
sdjacobs Jun 27, 2017
7efa78f
bump maven conveyal repo to https
sdjacobs Jun 27, 2017
a6fa013
disable mvn ssl re https://stackoverflow.com/questions/15691985/maven…
sdjacobs Jun 27, 2017
f499f81
Revert "disable mvn ssl re https://stackoverflow.com/questions/156919…
sdjacobs Jun 28, 2017
7d10b41
Update distribution management obaweb --> nexus
sdjacobs Jun 28, 2017
40d6dfd
Fix flag stop routing: TemporaryTransitBoardAlight at end of new patt…
sdjacobs Jul 2, 2017
e27bd2e
fix TransitBoardAlight class hierarchy, add some license headers
sdjacobs Jul 2, 2017
d07c74f
Merge commit '82d7a29' into vtrans-dev
sdjacobs Jul 2, 2017
09f91d2
remove snapshot dependencies, update pom for release
sdjacobs Jul 3, 2017
332f285
[maven-release-plugin] prepare release otp-1.2.0.0
sdjacobs Jul 3, 2017
642a890
[maven-release-plugin] prepare for next development iteration
sdjacobs Jul 3, 2017
0751290
[maven-release-plugin] rollback the release of otp-1.2.0.0
sdjacobs Jul 3, 2017
a054f5a
[maven-release-plugin] prepare release otp-1.2.0.0
sdjacobs Jul 3, 2017
58f4039
[maven-release-plugin] prepare for next development iteration
sdjacobs Jul 3, 2017
743dc75
[maven-release-plugin] rollback the release of otp-1.2.0.0
sdjacobs Jul 3, 2017
3d6b9ef
remove sonatype
sdjacobs Jul 3, 2017
976e697
[maven-release-plugin] prepare release otp-1.2.0.0
sdjacobs Jul 3, 2017
2e7e258
[maven-release-plugin] prepare for next development iteration
sdjacobs Jul 3, 2017
6ec4e74
VGF-29 and VGF-33: add boardAlightType, boardArea, and alightArea to …
sdjacobs Jul 5, 2017
45c8687
VGF-33 change boardArea and alightArea to flagStoparea
sdjacobs Jul 10, 2017
2f1463b
VGF-33 add logic to shift board/alight areas 8m to the right wrt the …
sdjacobs Jul 16, 2017
7be83fd
Disable conveyal repo as it does not work with camsys jenkins server
sdjacobs Jul 17, 2017
f28c516
revert GraphPath
sdjacobs Jul 17, 2017
7618658
Add config: turn flex routing off by default so tests pass
sdjacobs Jul 17, 2017
755b9ca
Remove conveyal repo so camsys jenkins works
sdjacobs Jul 17, 2017
0e89443
init park&ride - add demand services to graph, expose via IndexAPI
sdjacobs Jul 17, 2017
c6a77a5
Fix bug with patterns that do not have street network data
sdjacobs Jul 18, 2017
4526b76
add null check to avoid NPE
sdjacobs Jul 19, 2017
7052036
Add continuousStops to API output for stoptimes
sdjacobs Jul 13, 2017
63f1550
bump gtfs dependency for release
sdjacobs Jul 21, 2017
092ab19
[maven-release-plugin] prepare release otp-1.2.0.1-RC1
sdjacobs Jul 21, 2017
128f8d0
[maven-release-plugin] prepare for next development iteration
sdjacobs Jul 21, 2017
0144010
Ensure flag stop creation service only explores within walk distance
sdjacobs Jul 24, 2017
e109d40
VGF-43 add temp edges based on closest pattern hop, not closest trip …
sdjacobs Jul 25, 2017
6d444d4
VGF-33 fix buffer area: use Nick's algorithm
sdjacobs Jul 26, 2017
7bb01f0
VGF-48 fix buffer area with close-to-parallel segments
sdjacobs Jul 27, 2017
2e54b25
VGF-48 add some extra checks
sdjacobs Jul 28, 2017
f0e2960
PatternHop supports separate pickup/dropoff value
sdjacobs Jul 31, 2017
16f5bbf
Deviated route service
sdjacobs Jul 31, 2017
f80c290
Merge branch 'vtrans-dev' into add-route-deviation-squash
sdjacobs Aug 8, 2017
3986cf5
Some cleanup/bugfixes post-merge
sdjacobs Aug 8, 2017
77d8bec
Reorganize, add some documentation to graph modifiers, add deviated r…
sdjacobs Aug 8, 2017
e31eaa4
Add service area radius to API output
sdjacobs Aug 8, 2017
02b23da
bump gtfs version
sdjacobs Aug 8, 2017
78df530
[maven-release-plugin] prepare release otp-1.2.0.2-RC1
sdjacobs Aug 8, 2017
e575758
[maven-release-plugin] prepare for next development iteration
sdjacobs Aug 8, 2017
77c8c1b
VGF-41 make sure length of temporary hop is nonzero
sdjacobs Aug 10, 2017
9645718
VGF-54 - make sure flag stop locations are actually on the line of th…
sdjacobs Aug 11, 2017
1c64c41
VGF-56 apply flag stop penalty when boarding AND alighting
sdjacobs Aug 11, 2017
dd9db06
Initial commit for service areas for deviated-route service.
sdjacobs Aug 11, 2017
e7f3c06
Deviated-route service State.optimize bugfix. Also increase max searc…
sdjacobs Aug 14, 2017
2202d4d
VGF-58 bugfixes - forward and backward searches should be correct, fi…
sdjacobs Aug 16, 2017
4165ac6
fix NaN bug in PartialPatternHop
sdjacobs Aug 17, 2017
b5e9086
[maven-release-plugin] prepare release otp-1.2.0.3-RC1
sdjacobs Aug 17, 2017
9682204
[maven-release-plugin] prepare for next development iteration
sdjacobs Aug 17, 2017
64db083
Extend BusRouteStreetMatcher to edit geometry of PatternHops. Also re…
sdjacobs Aug 18, 2017
fdad9cb
VGF-19 implementation of call-n-ride which builds off deviated-fixed
sdjacobs Aug 21, 2017
db87705
Some refactoring for call-n-ride
sdjacobs Aug 21, 2017
a03786b
Output API params for call-n-ride
sdjacobs Aug 21, 2017
956f9b9
Fix street name for deviated-route service
sdjacobs Aug 21, 2017
825f1f8
Call-n-ride: Fix search for direct hop
sdjacobs Aug 22, 2017
538fbc2
Call-n-ride: fix start-time issue in API response
sdjacobs Aug 22, 2017
cc172a7
VGF-61 Save DRT parameters in graph
sdjacobs Aug 22, 2017
4f3061d
Some fixes so call-n-ride services will get looked up correctly
sdjacobs Aug 23, 2017
e387b8c
Call-n-ride: fix trip lookup
sdjacobs Aug 23, 2017
7b3f78e
Call-n-ride: use direct hops where appropriate
sdjacobs Aug 24, 2017
a90022e
bump gtfs dependency for release
sdjacobs Aug 24, 2017
42ef52e
[maven-release-plugin] prepare release otp-1.2.0.4-RC1
sdjacobs Aug 24, 2017
5fcdcf8
[maven-release-plugin] prepare for next development iteration
sdjacobs Aug 24, 2017
e1e5dc5
VGF-61 use DRT params to determine drive time
sdjacobs Aug 24, 2017
264ac13
Add maxStartTime/minEndTime for deviated board/alights to the plan AP…
sdjacobs Aug 24, 2017
552017c
VGF-67 call-n-ride can go to other transit stops
sdjacobs Aug 25, 2017
7d88625
Add call-n-ride reluctance multiplier
sdjacobs Aug 25, 2017
ebcd083
GTFS updates: drt pickup/dropoff messages, continuous_pickup/drop_off…
sdjacobs Aug 28, 2017
60992ad
Add check for bad hop-matching when creating partial hops
sdjacobs Aug 31, 2017
d3423e0
bump oba-gtfs dependency
sdjacobs Sep 1, 2017
d58881f
[maven-release-plugin] prepare release otp-1.2.0.5-RC1
sdjacobs Sep 1, 2017
bdae118
[maven-release-plugin] prepare for next development iteration
sdjacobs Sep 1, 2017
33c85a1
VGF-71 create call-n-ride legs for origin and destinatione even when …
sdjacobs Sep 8, 2017
dc515ef
[maven-release-plugin] prepare release 1.2.0.6-RC1
sdjacobs Sep 8, 2017
911019f
[maven-release-plugin] prepare for next development iteration
sdjacobs Sep 8, 2017
d64b89c
First pass at VGF-76 trip banning for call-n-ride
sdjacobs Sep 18, 2017
8e66a1b
VGF-75 for fare calcuation, use feed_id from route, since call-n-ride…
sdjacobs Sep 19, 2017
8f3a7da
VGF-59 allow routing from/to stops. Includes follow-on work regarding…
sdjacobs Sep 22, 2017
882e18a
Merge branch 'vtrans-dev' of https://github.com/camsys/OpenTripPlanne…
sdjacobs Sep 22, 2017
6100d71
VGF-83 if flex service is enabled, must link to segment with CAR perm…
sdjacobs Sep 26, 2017
fe0bd45
Fix street-transit link for call-n-ride: do not take link if its a no…
sdjacobs Sep 26, 2017
8b80ed5
VGF-79 put useEligibilityServices and useReservationServices in OTP, …
sdjacobs Sep 26, 2017
fb4bd28
Fix last-trip-is-call-n-ride check. Fixes failing tests, too
sdjacobs Sep 26, 2017
4e84448
Revert "VGF-75 for fare calcuation, use feed_id from route, since cal…
sdjacobs Sep 26, 2017
4eb8864
VGF-75 fix fare calculation - rides have their own feedId field, whic…
sdjacobs Sep 26, 2017
e655f98
VGF-79 don't use call-n-ride or deviated-route if useReservationServi…
sdjacobs Sep 27, 2017
a674369
Reduce call-n-ride time after trip plan based on call with Thomas
sdjacobs Sep 27, 2017
be67f47
[maven-release-plugin] prepare release otp-1.2.0.7
sdjacobs Sep 27, 2017
34ba84e
[maven-release-plugin] prepare for next development iteration
sdjacobs Sep 27, 2017
91b09f3
Revert "VGF-83 if flex service is enabled, must link to segment with …
sdjacobs Oct 10, 2017
97862fe
VGF-83 look for car accessible links at beginning of deviated-route s…
sdjacobs Oct 11, 2017
65dab1f
Some cleanup, future-proofing by making sure transit stops used for c…
sdjacobs Oct 11, 2017
de9c3d2
bugfix VGF-59
sdjacobs Oct 12, 2017
09d72db
InterleavedBidirectionalHeuristic: do not change underlying request, …
sdjacobs Oct 16, 2017
db261d5
[maven-release-plugin] prepare release otp-1.2.0.8
sdjacobs Oct 17, 2017
480cf43
[maven-release-plugin] prepare for next development iteration
sdjacobs Oct 17, 2017
cc17df8
Switch to WKT areas for Advance Transit
sdjacobs Oct 27, 2017
b11a3a4
do not initialize edge map if no streets
sdjacobs Nov 2, 2017
6a942c5
bugfix in pattern matcher
sdjacobs Nov 2, 2017
8be3812
bugfix in pattern matcher
sdjacobs Nov 2, 2017
71b637a
fix out-of-DAR issue
sdjacobs Nov 10, 2017
c3a4de7
VGF-92 fix the implementation of flag stops right at start or end point
sdjacobs Nov 21, 2017
2b34e57
VGF-122 add outside-of-area message
sdjacobs Nov 22, 2017
a109081
Add 'tripDiscoveryMode': look out two weeks in future or past
sdjacobs Nov 22, 2017
e7fa912
VGF-64 use drt_advanced_book_max in routing
sdjacobs Nov 27, 2017
157ca1a
fix test
sdjacobs Nov 29, 2017
54168ad
version bump
sdjacobs Nov 29, 2017
bc11857
[maven-release-plugin] prepare release otp-1.2.0.9
sdjacobs Nov 29, 2017
f5a2413
[maven-release-plugin] prepare for next development iteration
sdjacobs Nov 29, 2017
a9b460b
Add continuous pickup and dropoff messages to api response
sdjacobs Dec 12, 2017
c06ee74
change to out-of-area message
sdjacobs Dec 18, 2017
c4d01fc
bump gtfs
sdjacobs Dec 18, 2017
7225b74
[maven-release-plugin] prepare release otp-1.2.0.10
sdjacobs Dec 18, 2017
238d4ba
[maven-release-plugin] prepare for next development iteration
sdjacobs Dec 18, 2017
049e20d
tripDiscoveryMode - look out a month
sdjacobs Jan 9, 2018
dea212b
VGF-146 actual exclude walk parameter
sdjacobs Feb 6, 2018
78dd03e
VGF-80 eligibility services (just 0 and 1 values)
sdjacobs Feb 6, 2018
e3a32da
VGF-149 Add trips in past message
sdjacobs Feb 6, 2018
cf552b6
VGF-91 let maxWalkDistanceHeuristic be as large as necessary
sdjacobs Feb 7, 2018
5166629
VGF-91 add minimum length for partial edges
sdjacobs Feb 7, 2018
7ca5e2a
obagtfs version bump
sdjacobs Feb 14, 2018
94bc480
[maven-release-plugin] prepare release otp-1.2.0.11
sdjacobs Feb 14, 2018
9721d12
[maven-release-plugin] prepare for next development iteration
sdjacobs Feb 14, 2018
6476854
cleanup
sdjacobs May 22, 2018
ef963bb
WKT test
sdjacobs May 23, 2018
508c0bd
Initial commit for Vermont GTFS-flex integration tests
sdjacobs May 24, 2018
c41e87e
Add BoardAlightType to Ride and make assertions
sdjacobs May 24, 2018
8c91900
ADDING MORE TEST
mmaranda-cs Jun 7, 2018
e309139
Remove test of not-reservation service (GraphPathFinder not tested in…
sdjacobs Jun 18, 2018
625078c
Remove trip discovery mode
sdjacobs Jun 18, 2018
61f887c
Remove PlanNotesService - feature which adds notes to API results for…
sdjacobs Jun 18, 2018
20dad97
Merge remote-tracking branch 'otp/master' into vtrans-gtfs-flex
sdjacobs Jun 18, 2018
6000b5b
Remove flag stop transfer generator, unused and untested.
sdjacobs Jun 18, 2018
ec70774
Followup to merge, fix VTrans test
sdjacobs Jun 18, 2018
a2654e0
Remove demand-response services
sdjacobs Jun 18, 2018
5bf48c2
Remove shift by perpendicular vector
sdjacobs Jun 18, 2018
a925199
Revert change to GenericDijkstra
sdjacobs Jun 18, 2018
87601e0
Remove some non-functional changes relative to OTP-master
sdjacobs Jun 18, 2018
57794b1
Remove nonfunctional change
sdjacobs Jun 21, 2018
305d3c4
Fixup RoutingRequest.equals and RoutingRequest.hashCode
sdjacobs Jun 21, 2018
1af18a8
Move hop-for-edge map into FlexIndex
sdjacobs Jun 22, 2018
0737f93
DrtTravelTime fix: 2nd constant could be only one digit
sdjacobs Jul 10, 2018
e5d5399
VGF-161 DrtTravelTime fix: 2nd constant could be only one digit
sdjacobs Jul 10, 2018
5810367
VGF-162 make drt_advance_book_min a double
sdjacobs Jul 13, 2018
b798103
VGF-163 continuous_pickup and continuous_dropoff change to match spec
sdjacobs Jul 17, 2018
b0b4853
bump gtfs-modules
sdjacobs Jul 18, 2018
bc74cf9
Merge remote-tracking branch 'otp/master' into vtrans-gtfs-flex
sdjacobs Jul 18, 2018
64df0a0
Merge branch 'vtrans-dev' into vtrans-gtfs-flex
sdjacobs Jul 18, 2018
128defa
Revert pom.xml changes, except onebusaway-gtfs dependency
sdjacobs Jul 18, 2018
ede216c
Formatting change
sdjacobs Sep 21, 2018
04e90eb
Add documentation to GTFS-flex parameters
sdjacobs Sep 21, 2018
49de7eb
Additional API documentation
sdjacobs Sep 21, 2018
0c43736
Remove license headers
sdjacobs Sep 21, 2018
7bd093b
Fix docstring in IndexAPI
sdjacobs Sep 21, 2018
e2fca76
Formatting fix
sdjacobs Sep 24, 2018
b37b0a2
Implement Thomas's GTFS mapping suggestion
sdjacobs Sep 24, 2018
96e019a
Merge remote-tracking branch 'otp/master' into vtrans-gtfs-flex
sdjacobs Sep 24, 2018
1d1e904
Fix compilation error (perhaps due to my version of java): incompatib…
sdjacobs Sep 24, 2018
676b6ea
Add to changelog
sdjacobs Sep 25, 2018
c718f9d
Fix issue with maxWalkDistanceHeuristic infinite if not set
sdjacobs Sep 25, 2018
37ae200
bugfix: Geometry vs Polygon in StopPattern
sdjacobs Aug 13, 2018
9ca8209
Add termination condition for deviated/call-and-ride pre-search.
sdjacobs Sep 21, 2018
ca94075
Revert changes to InterleavedBidirectionalHeuristic
sdjacobs Nov 16, 2018
f58f592
Remove maxWalkDistanceHeuristic
sdjacobs Nov 16, 2018
b323dbd
Remove flex parameters from TripShort
sdjacobs Nov 16, 2018
cf79f98
Merge remote-tracking branch 'otp/master' into vtrans-gtfs-flex
sdjacobs Nov 16, 2018
4a848fd
Remove deviatedRouteLat/deviatedRouteLon
sdjacobs Nov 16, 2018
ea5573f
Remove URLs
sdjacobs Nov 20, 2018
0f2b097
Merge remote-tracking branch 'otp/master' into vtrans-gtfs-flex
sdjacobs Dec 11, 2018
6dfccf5
Add parameter documentation and flex parameter prefix. Remove some pa…
sdjacobs Dec 20, 2018
e3f4202
Add documentation for board-alight types
sdjacobs Dec 20, 2018
14e3c66
Standardize API response parameter names for GTFS-Flex
sdjacobs Dec 20, 2018
dc3a737
Add units to timeMillis parameter in GraphPathToTripPlanConverter
sdjacobs Dec 20, 2018
5587b10
Rename area to flexArea for disambiguation with other OTP areas
sdjacobs Dec 20, 2018
f168f51
Add to docs
sdjacobs Dec 20, 2018
48ef4f4
Formatting fix
sdjacobs Dec 20, 2018
21bd7c9
More documentation
sdjacobs Dec 20, 2018
b0629b2
Fix method visibility
sdjacobs Dec 24, 2018
0891b8b
Fix Call-And-Ride bug: call-and-ride should be fully within the defin…
sdjacobs Dec 27, 2018
c021473
Adding more documentation
sdjacobs Dec 27, 2018
cce248d
Refactoring flex-specific fields into a new class/new property of Sto…
sdjacobs Dec 27, 2018
f3a6b09
Deduplicate primitive arrays in StopPattern and StopPatternFlexFields
sdjacobs Dec 28, 2018
f46c326
Refactor GTFS-Flex-specific fields out of PatternHop; create new Flex…
sdjacobs Dec 28, 2018
e4f4d34
add documentation for enterStationsWithCar
sdjacobs Dec 28, 2018
7d448c4
Remove TemporaryTransitBoardAlight; make FlexTransitBoardAlight inher…
sdjacobs Dec 28, 2018
eb87c5d
Refactor to remove bad call-and-ride trip heuristic
sdjacobs Dec 28, 2018
c877cbb
Rename parameters
sdjacobs Dec 28, 2018
92d3395
Add more documentation around call-and-ride trip banning
sdjacobs Dec 28, 2018
d936b7b
Rename Area to FlexArea
sdjacobs Dec 28, 2018
e08b50b
Merge remote-tracking branch 'opentripplanner/master' into vtrans-gtf…
sdjacobs Jan 4, 2019
303cf56
Address GTFS-Flex implications of the new Vertex disposal code in PR …
sdjacobs Jan 4, 2019
3b8802b
Move FlexPatternHop to proper package
sdjacobs Jan 4, 2019
12968e6
Prevent TemporaryVertex on a different thread from being reached. In …
sdjacobs Jan 7, 2019
84b098b
Do not add GTFS-Flex temporary vertices to the graph (formerly these …
sdjacobs Jan 10, 2019
0ebf3d0
Add documentation
sdjacobs Jan 15, 2019
1feca7f
Merge remote-tracking branch 'otp/master' into vtrans-gtfs-flex
sdjacobs Jan 15, 2019
a275257
Parameter simplification: allow maxWalkDistance = 0 to be specified a…
sdjacobs Jan 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Update onebusaway-gtfs to latest version from OBA project (#2636)
- Remove the coupling to OneBusAway GTFS within OTP's internal model by creating new classes replacing the external classes (#2494)
- Allow itineraries in response to be sorted by duration (#2593)
- Add support for GTFS-flex services: flag stops, deviated-route service, and call-and-ride (#2603)

## 1.3 (2018-08-03)

Expand Down
70 changes: 70 additions & 0 deletions docs/Flex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# GTFS-Flex routing

Many agencies run flexible services to complement their fixed-route service. "Flexible" service does
not follow a strict timetable or route. It may include any of the following features: boardings
or alightings outside its scheduled timetable and route; booking and scheduling in advance; or
transit parameters which depend on customer requests ("demand-responsive transit" or DRT). These
services are typically used in rural areas or for mobility-impaired riders.

A GTFS extension called [GTFS-Flex](https://github.com/MobilityData/gtfs-flex/blob/master/spec/reference.md) defines
how to model some kinds of flexible transit. A subset of GTFS-Flex has been implemented in
OpenTripPlanner as part of US DOT's [Mobility-on-Demand Sandbox Grant](https://www.transit.dot.gov/research-innovation/fiscal-year-2016-mobility-demand-mod-sandbox-program-projects).

In particular, OTP now has support for these modes of GTFS-Flex:

- "flag stops", in which a passenger can flag down the a vehicle along its route to board, or
alight in between stops
- "deviated-route service", in which a vehicle can deviate from its route within an area or radius to
do a dropoff or pickup
- "call-and-ride", which is an entirely deviated, point-to-point segment.

These modes can co-exist with fixed-route transit, and with each other. For example, some agencies
have fixed-route services that start in urban areas, where passengers must board at designated
stops, but end in rural areas where passengers can board and alight wherever they please. A
fixed-route service may terminate in an defined area where it can drop off passengers anywhere --
or have such an area at the beginning or middle of its route. A vehicle may be able to deviate a
certain radius outside its scheduled route to pick up or drop off passengers. If both a pickup and
dropoff occur in between scheduled timepoints, from the passenger's perspective, the service may
look like a call-and-ride trip. Other call-and-ride services may operate more like taxis, in which
all rides are independently scheduled.

## Configuration

In order to use flexible routing, an OTP graph must be built with a GTFS-Flex dataset and
OpenStreetMap data. The GTFS data must include `shapes.txt`.

In addition, the parameter `useFlexService: true` must be added to `router-config.json`.

A number of routing parameters can be used to control aspects of flexible service. These parameters
typically change the relative cost of using various flexible services relative to fixed-route
transit. All flex-related parameters begin with the prefix "flex" and can be found in the Javadocs
for `RoutingRequest.java`.

The following example `router-config.json` enables flexible routing and sets some parameters:

{
"useFlexService": true,
"routingDefaults": {
"flexCallAndRideReluctance": 3,
"flexMaxCallAndRideSeconds": 7200,
"flexFlagStopExtraPenalty": 180
}
}

## Implementation

The general approach of the GTFS-Flex implementation is as follows: prior to the main graph search,
special searches are run around the origin and destination to discover possible flexible options.
One search is with the WALK mode, to find flag stops, and the other is in the CAR mode, to find
deviated-route and call-and-ride options. These searches result in the creation of temporary,
request-specific vertices and edges. Then, the graph search proceeds as normal. Temporary graph
structures are disposed at the end of the request's lifecycle.

For flag stops and deviated-route service, timepoints in between scheduled locations are determined
via linear interpolation. For example, say a particular trip departs stop A at 9:00am and arrives
at stop B at 9:30am. A passenger would be able to board 20% of the way in between stop A and stop B
at 9:06am, since 20% of 30 minutes is 6 minutes.

For deviated-route service and call-and-ride service, the most pessimistic assumptions of vehicle
travel time are used -- e.g. vehicle travel time is calculated via the `drt_max_travel_time`
formula in the GTFS-Flex (see the spec [here](https://github.com/MobilityData/gtfs-flex/blob/master/spec/reference.md#defining-service-parameters)).
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pages:
- Scripting: 'Scripting.md'
- Security: 'Security.md'
- Troubleshooting: 'Troubleshooting-Routing.md'
- GTFS-Flex Routing: 'Flex.md'
- Development:
- "Developers' Guide": 'Developers-Guide.md'
- Architecture: 'Architecture.md'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,36 @@ public abstract class RoutingResource {
@QueryParam("disableRemainingWeightHeuristic")
protected Boolean disableRemainingWeightHeuristic;

/*
* Control the size of flag-stop buffer returned in API response. This parameter only applies
* to GTFS-Flex routing, which must be explicitly turned on via the useFlexService parameter in
* router-config.json.
*/
@QueryParam("flexFlagStopBufferSize")
protected Double flexFlagStopBufferSize;

/**
* Whether to use reservation-based services
*/
@QueryParam("flexUseReservationServices")
protected Boolean flexUseReservationServices = true;

/**
* Whether to use eligibility-based services
*/
@QueryParam("flexUseEligibilityServices")
protected Boolean flexUseEligibilityServices = true;

/**
* Whether to ignore DRT time limits.
*
* According to the GTFS-flex spec, demand-response transit (DRT) service must be reserved
* at least `drt_advance_book_min` minutes in advance. OTP not allow DRT service to be used
* inside that time window, unless this parameter is set to true.
*/
@QueryParam("flexIgnoreDrtAdvanceBookMin")
protected Boolean flexIgnoreDrtAdvanceBookMin;

@QueryParam("maxHours")
private Double maxHours;

Expand Down Expand Up @@ -418,6 +448,8 @@ protected RoutingRequest buildRequest() throws ParameterException {
} else {
request.setDateTime(date, time, tz);
}

request.resetClockTime();
}

if (wheelchair != null)
Expand Down Expand Up @@ -595,6 +627,18 @@ protected RoutingRequest buildRequest() throws ParameterException {
if (disableRemainingWeightHeuristic != null)
request.disableRemainingWeightHeuristic = disableRemainingWeightHeuristic;

if (flexFlagStopBufferSize != null)
request.flexFlagStopBufferSize = flexFlagStopBufferSize;

if (flexUseReservationServices != null)
request.flexUseReservationServices = flexUseReservationServices;

if (flexUseEligibilityServices != null)
request.flexUseEligibilityServices = flexUseEligibilityServices;

if (flexIgnoreDrtAdvanceBookMin != null)
request.flexIgnoreDrtAdvanceBookMin = flexIgnoreDrtAdvanceBookMin;

if (maxHours != null)
request.maxHours = maxHours;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.opentripplanner.api.model;

/**
* Distinguish between special ways a passenger may board or alight at a stop. The majority of
* boardings and alightings will be of type "default" -- a regular boarding or alighting at a
* regular transit stop. Currently, the only non-default types are related to GTFS-Flex, but this
* pattern can be extended as necessary.
*/
public enum BoardAlightType {
Copy link
Member

Choose a reason for hiding this comment

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

What does "default" mean here? Please add documentation. The name "BoardAlightType" seems very general - in fact this is highly specific to handling flex transit.


/**
* A regular boarding or alighting at a fixed-route transit stop.
*/
DEFAULT,

/**
* A flag-stop boarding or alighting, e.g. flagging the bus down or a passenger asking the bus
* driver for a drop-off between stops. This is specific to GTFS-Flex.
*/
FLAG_STOP,

/**
* A boarding or alighting at which the vehicle deviates from its fixed route to drop off a
* passenger. This is specific to GTFS-Flex.
*/
DEVIATED;
}
54 changes: 54 additions & 0 deletions src/main/java/org/opentripplanner/api/model/Leg.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,60 @@ public class Leg {
@JsonSerialize
public Boolean rentedBike;

/**
* True if this is a call-and-ride leg.
*/
@XmlAttribute
@JsonSerialize
public Boolean callAndRide;

/* For call-n-ride leg, supply maximum start time based on calculation. */
@XmlAttribute
@JsonSerialize
public Calendar flexCallAndRideMaxStartTime = null;

/* For call-n-ride leg, supply minimum end time based on calculation. */
@XmlAttribute
@JsonSerialize
public Calendar flexCallAndRideMinEndTime = null;

/** trip.drt_advance_book_min if this is a demand-response leg */
@XmlAttribute
@JsonSerialize
public double flexDrtAdvanceBookMin;

/**
* Agency message if this is leg has a demand-response pickup and the Trip has
* `drt_pickup_message` defined.
*/
@XmlAttribute
@JsonSerialize
public String flexDrtPickupMessage;

/**
* Agency message if this is leg has a demand-response dropoff and the Trip has
* `drt_drop_off_message` defined.
*/
@XmlAttribute
@JsonSerialize
public String flexDrtDropOffMessage;

/**
* Agency message if this is leg has a flag stop pickup and the Trip has
* `continuous_pickup_message` defined.
*/
@XmlAttribute
@JsonSerialize
public String flexFlagStopPickupMessage;

/**
* Agency message if this is leg has a flag stop dropoff and the Trip has
* `continuous_drop_off_message` defined.
*/
@XmlAttribute
@JsonSerialize
public String flexFlagStopDropOffMessage;

/**
* Whether this leg is a transit leg or not.
* @return Boolean true if the leg is a transit leg
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/org/opentripplanner/api/model/Place.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.opentripplanner.util.Constants;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.opentripplanner.util.model.EncodedPolylineBean;

/**
* A Place is where a journey starts or ends, or a transit stop along the way.
Expand Down Expand Up @@ -91,6 +92,19 @@ public class Place {
*/
public String bikeShareId;

/**
* This is an optional field which can be used to distinguish among ways a passenger's
* boarding or alighting at a stop can differ among services operated by a transit agency.
* This will be "default" in most cases. Currently the only non-default values are for
* GTFS-Flex board or alight types.
*/
public BoardAlightType boardAlightType;
Copy link
Member

Choose a reason for hiding this comment

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

Please expand the Javadoc a bit. Does this distinguish between different flexible transit modes, or between flexible modes and fixed route modes? This field name should probably be prefixed / scoped to indicate that it only applies to flex situations. In non-flex responses perhaps it should just be null (left out).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added some documentation for this. The intention was that this would be "BoardAlightType.default" in the vast majority of cases, and if the boarding or alighting is nonstandard in some way, it would be another value. Right now, the only nonstandard cases are for GTFS-Flex, but that won't necessarily always be the case. I added documentation to that effect. But another approach could be to make this flex specific and leave null otherwise. Any drawbacks/benefits to switching approaches?

Copy link
Member

Choose a reason for hiding this comment

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

I still find that the name "BoardAlightType" is very general, and the documentation here and on the enum is basically tautological: it's a "type of board or alight". There is still not much information about what this field means or what it is used for.


/**
* Board or alight area for flag stops
*/
public EncodedPolylineBean flagStopArea;

/**
* Returns the geometry in GeoJSON format
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import org.opentripplanner.routing.alertpatch.AlertPatch;
import org.opentripplanner.routing.core.*;
import org.opentripplanner.routing.edgetype.*;
import org.opentripplanner.routing.edgetype.flex.PartialPatternHop;
import org.opentripplanner.routing.edgetype.flex.TemporaryDirectPatternHop;
import org.opentripplanner.routing.error.TrivialPathException;
import org.opentripplanner.routing.graph.Edge;
import org.opentripplanner.routing.graph.Graph;
Expand Down Expand Up @@ -182,9 +184,13 @@ public static Itinerary generateItinerary(GraphPath path, boolean showIntermedia

private static Calendar makeCalendar(State state) {
RoutingContext rctx = state.getContext();
TimeZone timeZone = rctx.graph.getTimeZone();
TimeZone timeZone = rctx.graph.getTimeZone();
return makeCalendar(timeZone, state.getTimeInMillis());
}

private static Calendar makeCalendar(TimeZone timeZone, long timeMillis) {
Calendar calendar = Calendar.getInstance(timeZone);
calendar.setTimeInMillis(state.getTimeInMillis());
calendar.setTimeInMillis(timeMillis);
return calendar;
}

Expand All @@ -194,11 +200,11 @@ private static Calendar makeCalendar(State state) {
* @param edges The array of input edges
* @return The coordinates of the points on the edges
*/
private static CoordinateArrayListSequence makeCoordinates(Edge[] edges) {
public static CoordinateArrayListSequence makeCoordinates(Edge[] edges) {
CoordinateArrayListSequence coordinates = new CoordinateArrayListSequence();

for (Edge edge : edges) {
LineString geometry = edge.getGeometry();
LineString geometry = edge.getDisplayGeometry();

if (geometry != null) {
if (coordinates.size() == 0) {
Expand Down Expand Up @@ -585,6 +591,11 @@ private static void addTripFields(Leg leg, State[] states, Locale requestedLocal
leg.tripId = trip.getId();
leg.tripShortName = trip.getTripShortName();
leg.tripBlockId = trip.getBlockId();
leg.flexDrtAdvanceBookMin = trip.getDrtAdvanceBookMin();
leg.flexDrtPickupMessage = trip.getDrtPickupMessage();
leg.flexDrtDropOffMessage = trip.getDrtDropOffMessage();
leg.flexFlagStopPickupMessage = trip.getContinuousPickupMessage();
leg.flexFlagStopDropOffMessage = trip.getContinuousDropOffMessage();

if (serviceDay != null) {
leg.serviceDate = serviceDay.getServiceDate().getAsString();
Expand All @@ -593,6 +604,30 @@ private static void addTripFields(Leg leg, State[] states, Locale requestedLocal
if (leg.headsign == null) {
leg.headsign = trip.getTripHeadsign();
}

Edge edge = states[states.length - 1].backEdge;
if (edge instanceof TemporaryDirectPatternHop) {
leg.callAndRide = true;
}
if (edge instanceof PartialPatternHop) {
PartialPatternHop hop = (PartialPatternHop) edge;
int directTime = hop.getDirectVehicleTime();
TripTimes tt = states[states.length - 1].getTripTimes();
int maxTime = tt.getDemandResponseMaxTime(directTime);
int avgTime = tt.getDemandResponseAvgTime(directTime);
int delta = maxTime - avgTime;
if (directTime != 0 && delta > 0) {
if (hop.isDeviatedRouteBoard()) {
long maxStartTime = leg.startTime.getTimeInMillis() + (delta * 1000);
leg.flexCallAndRideMaxStartTime = makeCalendar(leg.startTime.getTimeZone(), maxStartTime);
}
if (hop.isDeviatedRouteAlight()) {
long minEndTime = leg.endTime.getTimeInMillis() - (delta * 1000);
leg.flexCallAndRideMinEndTime = makeCalendar(leg.endTime.getTimeZone(), minEndTime);
}
}
}

}
}

Expand Down Expand Up @@ -686,6 +721,22 @@ private static Place makePlace(State state, Vertex vertex, Edge edge, Stop stop,
place.stopSequence = tripTimes.getStopSequence(place.stopIndex);
}
place.vertexType = VertexType.TRANSIT;
place.boardAlightType = BoardAlightType.DEFAULT;
if (edge instanceof PartialPatternHop) {
PartialPatternHop hop = (PartialPatternHop) edge;
if (hop.hasBoardArea() && !endOfLeg) {
place.flagStopArea = PolylineEncoder.createEncodings(hop.getBoardArea());
}
if (hop.hasAlightArea() && endOfLeg) {
place.flagStopArea = PolylineEncoder.createEncodings(hop.getAlightArea());
}
if ((endOfLeg && hop.isFlagStopAlight()) || (!endOfLeg && hop.isFlagStopBoard())) {
place.boardAlightType = BoardAlightType.FLAG_STOP;
}
if ((endOfLeg && hop.isDeviatedRouteAlight()) || (!endOfLeg && hop.isDeviatedRouteBoard())) {
place.boardAlightType = BoardAlightType.DEVIATED;
}
}
} else if(vertex instanceof BikeRentalStationVertex) {
place.bikeShareId = ((BikeRentalStationVertex) vertex).getId();
LOG.trace("Added bike share Id {} to place", place.bikeShareId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.opentripplanner.common.geometry;

import com.vividsolutions.jts.geom.*;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;
import com.vividsolutions.jts.linearref.LengthLocationMap;
import com.vividsolutions.jts.linearref.LinearLocation;
import com.vividsolutions.jts.linearref.LocationIndexedLine;
Expand Down Expand Up @@ -181,4 +183,13 @@ private static Coordinate[] convertPath(List<LngLatAlt> path) {
}
return coords;
}

public static Geometry parseWkt(String wkt) {
try {
return new WKTReader(GeometryUtils.getGeometryFactory()).read(wkt);
} catch(ParseException e) {
LOG.error("Unable to parse wkt: " + e);
}
return null;
}
}
Loading