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

incorrect shape_dist_travelled #17

Closed
RuiLoureiro opened this issue Aug 25, 2020 · 2 comments
Closed

incorrect shape_dist_travelled #17

RuiLoureiro opened this issue Aug 25, 2020 · 2 comments

Comments

@RuiLoureiro
Copy link

First of all, thank you for your work. It is helping me a lot in my masters thesis.

This issue is related to #7.
I'm trying to find the street point where a bus stops at a stop.

I'm doing what was recommended by @patrickbr in #7:

You can exactly encode where a trip comes to a stop on a shape by the value of shape_dist_traveled in stop_times.txt. pfaedle should correctly update the shape_dist_traveled value after map-matching, so you can very easily get the position on a shape where the vehicle stops at a station.

However, I'm not getting correct results.
For example, the following plot shows the GTFS stop location (blue), the shape points (green) and the shape point with the closest shape_dist_traveled (red).

incorrect

This repository has the code used to generate the above plot (in a python jupyter notebook):
https://github.com/RuiLoureiro/pfaedle_issue

Here's what I used:

Ran pfaedle inside the gtfs folder:
pfaedle -D -x ../portugal-latest.osm .

Am I doing something wrong?

@RuiLoureiro RuiLoureiro changed the title shape_dist_travelled gives incorrect result incorrect shape_dist_travelled Aug 25, 2020
@patrickbr
Copy link
Member

patrickbr commented Aug 25, 2020

This is most likely because there is no station at your blue position in OSM: https://www.openstreetmap.org/search?query=estrada%20de%20a-da-maia#map=19/38.75210/-9.20601

pfaedle prefers positions for stations which are already mapped in OSM. To change this behaviour, you can try lowering the routing_non_osm_station_punish option in pfaedle.cfg (you can either edit the one that is installed to /usr/share/pfaedle, or create a new one in your home directory, or give the configuration file via the -c parameter).

For [bus], you could for example set

routing_non_osm_station_punish = 0

@RuiLoureiro
Copy link
Author

That was it! Thank you

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

No branches or pull requests

2 participants