-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat(routing): use graphhopper to provide GTFS based public transport routing #441
base: main
Are you sure you want to change the base?
Conversation
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 new feature! However, I think there is some refactoring necessary before merging this PR.
@@ -83,11 +87,22 @@ public class CentralNavigationComponent { | |||
*/ | |||
private Routing routing; | |||
|
|||
|
|||
/** | |||
* Public Transport routing |
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.
Checkstyle would probably like a dot here :D
* Configuration options for route calculation via public transport. | ||
* Requires paths to OSM and GTFS files. | ||
*/ | ||
public CPublicTransportRouting publicTransportConfiguration = new CPublicTransportRouting(); |
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.
It's a little bit confusing that we define default configs for the perception and publicTransportRouting but not for the navigationConfiguration
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.
They both now have default configs.
@@ -20,7 +20,7 @@ | |||
/** | |||
* Base Class for the navigation configuration. | |||
*/ | |||
public class CRouting implements Serializable { | |||
public class CVehicleRouting implements Serializable { | |||
|
|||
/** | |||
* The source for the route calculation, e.g. the path to the database containing the road network. |
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.
* The source for the route calculation, e.g. the path to the database containing the road network. | |
* The source for the route calculation, e.g., the path to the database containing the road network. |
private WalkLeg walkLeg = null; | ||
|
||
//For legs where a vehicle already exists | ||
private String carID = null; |
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.
private String carID = null; | |
private String carId = null; |
//For legs where a vehicle needs to be spawned | ||
private VehicleDeparture vehicleLeg = null; | ||
|
||
//For PTlegs |
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.
This comment isn't really explaining much and can be formatted nicer
//For PTlegs | |
// For {@link PtLeg PtLegs} |
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.
Improved javadoc a lot here
return scheduleDateTime.plusNanos(simTime).atZone(timeZone).toInstant(); | ||
} | ||
|
||
private Long fromScheduleTime(Date date) { |
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.
private Long fromScheduleTime(Date date) { | |
private Long fromScheduleTime(@Nonnull Date date) { |
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.
Erm, you mean @Nullable
? The method is able to handle the null
case.
).createWithoutRealtimeFeed(); | ||
} | ||
|
||
|
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.
Remove some blank lines here
return scheduleDateTime.until(LocalDateTime.ofInstant(instant, timeZone), ChronoUnit.NANOS); | ||
} | ||
|
||
public void close() { |
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.
This seems to never be used?
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.
Now it does
lib/mosaic-routing/src/test/java/org/eclipse/mosaic/lib/routing/pt/PtRoutingTest.java
Show resolved
Hide resolved
lib/mosaic-routing/src/test/java/org/eclipse/mosaic/lib/routing/pt/PtRoutingTest.java
Outdated
Show resolved
Hide resolved
@schwepmo I also added a small |
a8aaca0
to
3e0229a
Compare
Description
A new routing interface for finding public transport routes.
Open issues:
graphhopper-reader-gtfs
io.mobilitydata.transit:gtfs-realtime-bindings
org.mapdb:mapdb
approveapprovejavacsv
- it's LGPL and I cannot find its source code :(opencsv
Issue(s) related to this PR
Affected parts of the online documentation
Changes in the documentation required?
Definition of Done
Prerequisites
Required
type(scope): description
(in the style of Conventional Commits)enhancement
, orbugfix
)origin/main
has been merged into your Fork.Requested (can be enforced by maintainers)
Special notes to reviewer