planarnetwork / transxchange2gtfs

tool to convert transxchange data into a GTFS feed
30 stars 17 forks source link

Problem "Cannot read property 'RegularDayType'" #43

Closed tafflin closed 3 years ago

tafflin commented 3 years ago

@linusnorton Hi, I found a problem converting txc .xml file which we get from DFT. (https://www.bus-data.dft.gov.uk/) Looks like the latest changes concerning Holidays negatively impacted on the ability to convert DFT transxchange data.

Processing 113_KCTR_1132561320120402.xml
(node:3227) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'RegularDayType' of undefined
    at TransXChangeJourneyStream.getCalendar (/usr/lib/node_modules/transxchange2gtfs/dist/src/transxchange/TransXChangeJourneyStream.js:61:39)
    at TransXChangeJourneyStream._transform (/usr/lib/node_modules/transxchange2gtfs/dist/src/transxchange/TransXChangeJourneyStream.js:44:39)
    at TransXChangeJourneyStream.Transform._read (internal/streams/transform.js:205:10)
    at TransXChangeJourneyStream.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at TransXChangeJourneyStream.Writable.write (internal/streams/writable.js:303:10)
    at TransXChangeStream.ondata (internal/streams/readable.js:726:22)
    at TransXChangeStream.emit (events.js:412:35)
    at addChunk (internal/streams/readable.js:290:12)
    at readableAddChunk (internal/streams/readable.js:265:9)

113_KCTR_1132561320120402.zip

tafflin commented 3 years ago

ps this file is not the only one causing such problems

linusnorton commented 3 years ago

how should VJ_3_2396702 work? Service 113 has no operating profile

tafflin commented 3 years ago

I'm not responsible for the data quality, it's just what we receive from DFT. I will look into this trip and how it was converted in GTFS with the previous ver of the utility.

I can only say that the previous version of txc converter managed to deal with such files and generated a resulting GTFS while with this version I cannot get the conversion done. There is a number of such files which show the same error in the bulk DFT archive with txc .xml files and it looks new to me after we updated the converter with the latest changes.

I will report the issue with the file to DFT as well since you noticed that there is a problem in the source .xml file.

linusnorton commented 3 years ago

Okay, I'll rollback the code and see what it was doing differently. On the surface it doesn't look like any recent changes should have caused a problem

linusnorton commented 3 years ago

Just confirmed that that 1.8.2 also failed with this file

tafflin commented 3 years ago

@linusnorton the route I sent you has RegularDayType node in StandardService section which says it works Mon-Fri. Vehicle journeys are linked with Journey Patterns which have operating profile изображение

linusnorton commented 3 years ago

@tafflin please try 1.8.7

tafflin commented 3 years ago

@linusnorton thanks the fix is working and the conversion was successfull for such files. However a new issue appeared, created a separate ticket.