ITSLeeds / UK2GTFS

Convert UK transport data (TransXchange / ATOC CIF) to GTFS format in R
https://itsleeds.github.io/UK2GTFS/
GNU General Public License v3.0
37 stars 13 forks source link

ATOC Request Stops #31

Closed stupidpupil closed 2 years ago

stupidpupil commented 3 years ago

I think that "request only stops" can just have the CIF activity code "R". At the moment, these are being dropped by atoc2gtfs as far as I can tell.

I believe that only necessary change is at: https://github.com/ITSLeeds/UK2GTFS/blob/1a8cde20af5c3e11c65196e05ea3d73b4ebb86e0/R/atoc_import.R#L414-L419

But I thought I should ask before I attempt to tackle this!

Example

BSNG760442105172109101111100 POO2M105058125435000 DMUS   075      S S          P
BX         AWYAW505800                                                          
LOSWANSEA 1435 14351         TB                                                 
LISWANSLE           1437 00000000         X                                     
LISWANSLW           1439 00000000                                               
LICOCKETW           1444 00000000                                               
LIDUFRYNW           1448H00000000                                               
LILLDELOJ           1449 00000000                                               
LILLNLLI  1450H1453H     14521453DPL      T RM                                  
LILLDELOJ2          1456 00000000                                               
LIBYNEA   1458 1458H     14571457         R                                     
LILLGNNCH 1502 1502H     15011501         R                                     
LIMORLASJ           1504 00000000                                               
LIHENDYJ            1505H00000000                                               
LIPNTADLS 1506H1507      15061506         R                                     
LIPNTYFYN 1513H1514H     15141514         T                                     
LIAMMANFD 1517 1517H     15171517         T                                     
LILLDYBIE 1521H1522      15221522         T                                     
LIFFAIRFC 1529 1529H     15281528         R                                     
LILLDEILO 1531H1534H     15331534         T                                     
LILLGADOG 1543H1544      15441544         T                                     
LILLWRDA  1547 1547H     15471547         T                                     
LILLDVERY 1553H1556H     15551556         T                                     
LICYNGHRD 1604H1604H     16031603         R                                                                                 

Screen Shot 2021-07-09 at 23 47 25

mem48 commented 3 years ago

So is the fix just to add "R" to the list?

stupidpupil commented 3 years ago

That's what I've done in my fork and seems to be working alright. I guess I should also add an entry to activity_codes.

mem48 commented 3 years ago

Yes, the activity_codes are a pain as there are so many, and no easy way to check them. The lookup table is an inelegant solution, but will need to have all variants including an "R" added.

mem48 commented 3 years ago

I've committed a new way to handle activity codes, which should fix the old Unknown Activity Code message and now also give a GTFS pickup and drop_off code of 3 to stops with an R code. Let me know if this gives the expected results.