Closed marcbosch-idencity closed 3 years ago
Hi @marcbosch-idencity !
I took a quick look at that specific feed you are using in red_Cercanias_feve.ipynb
and I see that there are spaces in the trip_id
values from the stop_times
file while the trip_id
in the trips
file has no spaces. When UrbanAccess does its lookup and join on this column its technically seeing different values due to the spaces which results in no records found when the lookup is performed leading to the error you posted.
Ill put together a PR for the next release to add whitespace checks and corrections on columns used for GTFS file relations so that whitespace can be automatically removed in the specific columns.
In the meantime you can pre-process your GTFS files that have this discrepancy by doing this on the columns that have the issue for example for trip_id
: df['trip_id'] = df['trip_id'].str.rstrip().str.lstrip()
That worked with the cercanías_Feve feed, so thank you very much!
PR to fix cases like this is here: https://github.com/UDST/urbanaccess/pull/85
I am trying to create a network with all train lines in Spain, but two feeds are not passed into the network, i.e. they are properly downloaded, but when I try to create the network, they are not included. The two GTFS giving me problems are the following.
GTFS feeds
https://ssl.renfe.com/ftransit/Fichero_CER_FOMENTO/fomento_transit.zip
https://www.fgc.cat/google/google_transit.zip
Environment
Operating system: Windows 10
Python version: 3.7.8
UrbanAccess version: 0.2.2
The code I'm running is found here
https://github.com/marcbosch-idencity/urbanaccess-example/blob/main/longitudes_frecuencias_trenes.ipynb
Here is a specific script only for one of the GTFS feeds giving me problems.
https://github.com/marcbosch-idencity/urbanaccess-example/blob/main/red_Cercanias_feve.ipynb
When I run this line
I get the following error
When running the notebook with all feeds, the script does not return any errors, it just does not include the stops from the two 'problematic' feeds into the network.