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

Fix traffic analysis for nodes attached to multiple nodes #192

Closed
Tracked by #198
Carsopre opened this issue Sep 21, 2023 · 1 comment · Fixed by #207
Closed
Tracked by #198

Fix traffic analysis for nodes attached to multiple nodes #192

Carsopre opened this issue Sep 21, 2023 · 1 comment · Fixed by #207
Assignees

Comments

@Carsopre
Copy link
Collaborator

Carsopre commented Sep 21, 2023

In traffic_analysis_base.py we created the function _get_accumulated_traffic_from_node_list to handle a list of origins nodes which were contained within one node.
This is due to a fault when reading the graph, apparently the "centroid" used to find the closest origin gets attached to two (or many) different nodes, ideally we want to only attach to the closest one to the "centroid".

What needs to be done

  • Make sure the traffic analysis does not calculate traffic for the described situation, just pick one of the nodes.
  • Ensure the reading of the graph does not contain multiple nodes within one origin.
@Carsopre
Copy link
Collaborator Author

What was failing:
We were making a GeoDataFrame in analysis_indirect.find_route_ods with a list of nodes where more than one origin node was present within a lon / lat position, this will condition the rest of the ra2ce code using such dataframe.

What has been done:
When generating a list of tuples with origin - destination we expand the list so that no origin contains a list of names. So for such an entry [O1, O2, O3] - [D1] we create now 3 entries [O1 - D1], [O2-D1], [O3-D1].
This, however, does not prevent from duplicates in the GeoDataFrame. For such, just before returning the final structure for analysis_indirect.find_route_ods we will remove all duplicates where the o_node, d_node, destination, length and geometry are the same, taking the very first entry as prevalent.

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 a pull request may close this issue.

1 participant