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

Validation zhuzh-up: PT speed computation #147

Merged
merged 36 commits into from
Oct 10, 2022
Merged

Conversation

KasiaKoz
Copy link
Collaborator

Resolves: #145 - Add speed computation and checks

  • Adds a method to get a DataFrame with routes : speed (where the speeds are between stop pairs: crowfly distance times a network factor that defaults to 1.3)
  • Adds a method to get average speed for each route (average between stop-to-stop pairs)
  • Adds checks for 0 and infinity values of speeds in the validation report
  • Adds a geojson/shp file output with stop-to-stop speeds in standard outputs, example pic below:
    Screenshot 2022-09-15 at 09 17 49

Nb. Part of a wider validation upgrade series. I'm leaving updating the notebook: 6.1. Validating Network: MATSim Specific to last in the series.

KasiaKoz and others added 29 commits August 17, 2022 10:52
…ay-values

# Conflicts:
#	tests/test_core_network.py
Copy link
Contributor

@elizabethc-arup elizabethc-arup left a comment

Choose a reason for hiding this comment

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

This is a really quick and effective way to visualise and validate the speeds of the schedule :D I had a few questions in regards to the network factor:

  • Why is it used instead of the actual length of the route / links?
  • Would the idea be to adjust the network factor based on how windy the roads are in an area?

@KasiaKoz
Copy link
Collaborator Author

Why is it used instead of the actual length of the route / links?

The schedule object doesnt have any information about the network links it's referring to, but mostly laziness. This is a very valid point and I updated the PR with extra functionality. If you pass the network links geodataframe, the method will calculate the routed, network distance and use it for a routed speed. it will return both speeds, because I think each has its' benefits to be looked and limitations.
It's baked into standard outputs to do this automatically and output both speeds as geojsons (/shp files if requested)

Example routes speed geojson (highlights a bad speed for a bus due to a bad snap)
Screenshot 2022-09-26 at 17 26 07

Would the idea be to adjust the network factor based on how windy the roads are in an area?

Yeah I guess different locations will have a different target for a network route to straight line distance ratio, so I left it open to give the user flexibility :)

Copy link
Contributor

@elizabethc-arup elizabethc-arup left a comment

Choose a reason for hiding this comment

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

This looks really good! I especially like the idea of having both the options of using the network factor and the route distance to calculate speed which could also be handy for quick visual validations. :D

Base automatically changed from lab-1250-check-headway-values to main October 7, 2022 17:12
@KasiaKoz KasiaKoz merged commit 27f95bb into main Oct 10, 2022
@KasiaKoz KasiaKoz deleted the lab-1867-pt-speed-checks branch October 10, 2022 08:15
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.

Check for PT speed in validation
2 participants