Skip to content
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

[jormungandr] implement access_points in transfer path #3872

Merged
merged 8 commits into from
Dec 15, 2022

Conversation

xlqian
Copy link
Member

@xlqian xlqian commented Dec 8, 2022

With this PR. transfer paths are allowed between surface transport vehicles (tramway, bus etc...) and underground transport vehicles (metro etc...) via access points.

Note that :

  • no transfer path will be calculated if access points are not available for the underlying underground transport vehicles.
  • no transfer path will be calculated if both stop points of the transfer are underground. (this case may be handled later)

How the access point (if multiple access points are present for the underlying stop point) is picked in a nutshell:

Let's say we need to calculate the path from stop_point:Tramway to stop_point: Metro, given that stop_point: Metro has 3 access points around it. The first step is to choose the eligible access points by requesting the georef all the access points of stop_point:Metro and filtering out those are is_entrance == False. Then we compute a matrix of 1xN (reciprocally Nx1 when transferring from stop_point:Metro to stop_point:Tramway). By adding up the traversal_time of each access points to the street network duration, we pick the most rapid access point to get to stop_point:Metro. Then we launch the real street network computation between stop_point:Tramway and the chosen access point.

In the following example, the blue line (underground transport) has multiple access points,
image

but we finally chose the best/most rapid access point to get to the platform
image

@xlqian xlqian marked this pull request as ready for review December 12, 2022 13:56
@xlqian xlqian force-pushed the use_access_points_in_transfer_path branch from a9a512b to 74d0caa Compare December 13, 2022 13:06
@@ -766,3 +777,34 @@ def complete_transfer(pt_journey, transfer_pool):
if section.type != response_pb2.TRANSFER:
continue
transfer_pool.wait_and_complete(section)


def prepend_first_and_append_last_coord(dp, origin, destination):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe split this function in two prepend_first_coord() and append_last_coord() ?

Copy link
Contributor

Choose a reason for hiding this comment

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

And don't you already have the exact same function here ?

Comment on lines 789 to 791
nb_coords = sum((len(sec.street_network.coordinates) for sec in dp.journeys[0].sections))
if nb_coords < 2:
return
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand this check. Maybe add some comments ?

Copy link
Member Author

Choose a reason for hiding this comment

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

it just checks the length of the geojson of the street network, there should be at least 2 points in a geojson logically

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

81.9% 81.9% Coverage
0.0% 0.0% Duplication

@xlqian xlqian merged commit 92bbea0 into dev Dec 15, 2022
@xlqian xlqian deleted the use_access_points_in_transfer_path branch December 15, 2022 13:14
@woshilapin woshilapin changed the title [Jormungandr] implement access_points in transfer path [jormungandr] implement access_points in transfer path Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants