incorrect shape_dist_travelled
RuiLoureiro opened this issue · 2 comments
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).
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:
- GTFS - https://openmobilitydata-data.s3-us-west-1.amazonaws.com/public/feeds/carris/1000/20200201/gtfs.zip
- osm file - https://download.geofabrik.de/europe/portugal-latest.osm.bz2
- The plot above was done for
stop_id
1_11009,trip_id
25838795 andshape_id
shp_3_212
Ran pfaedle inside the gtfs folder:
pfaedle -D -x ../portugal-latest.osm .
Am I doing something wrong?
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
That was it! Thank you