-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate PT #1824
Integrate PT #1824
Conversation
# Conflicts: # reader-gtfs/src/main/java/com/graphhopper/reader/gtfs/GraphHopperGtfs.java # reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
And a good timing for 1.0 and #1776 :)
@@ -521,6 +521,7 @@ public GraphHopper init(CmdArgs args) { | |||
if (!flagEncodersStr.isEmpty() || !encodedValueStr.isEmpty()) { | |||
if (!encodedValueStr.isEmpty()) | |||
emBuilder.addAll(tagParserFactory, encodedValueStr); | |||
registerCustomEncodedValues(emBuilder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is a bit unfortunate that this is necessary but we would need yet another factory (EncodedValueFactory) plus a method in EncodingManager to support this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, talking about factories, extension points and such is a new issue, or epic. But I don't think it's that bad in this case. "Builder" sounds like something that should be safe to pass around and add stuff to.
Goal: Functionally integrate PT with rest of GraphHopper, meaning I can put PT into a regular instance that also has other modes, CH etc.
Secondary goal: Also integrate the code a bit.
I still use my own web resources. I just forward requests with
?vehicle=pt
to my own resource. (Invisibly. No HTTP redirect, just give Jersey a hint where the request must go.)GraphHopperGtfs
is now analogous toGraphHopperOSM
(and inherits from it, for better or worse).I needed two extra entry points in
GraphHopper
, and I still need to trickGraphHopper
in two places: First, I may want to create a Graph completely without an OSM network, so I need to bypass a validation. Second, I need to reset theLocationIndex
because I need it after importing OSM, but I can only finish it after importing GTFS.In
/info
, I need to add PT as an extra mode if we have it, because it doesn't correspond to aFlagEncoder
.