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

loadGTFS doesn't work. #17

Open
ghost opened this issue Oct 17, 2023 · 16 comments
Open

loadGTFS doesn't work. #17

ghost opened this issue Oct 17, 2023 · 16 comments

Comments

@ghost
Copy link

ghost commented Oct 17, 2023

So I've tried the readme examples, but it gets stuck on loadGTFS. The gtfs file I am using is this one from https://www.digitraffic.fi/en/railway-traffic/#gtfs.

@linusnorton
Copy link
Contributor

I fairly quick seems to indicate it's working with that file:

HKI_7 -> LR_1 today at 6am shows:

06:55:00, 09:07:00, HKI_7-LR_1

What inputs are you using and what output are you getting?

@ghost ghost closed this as completed Oct 17, 2023
@ghost ghost reopened this Oct 17, 2023
@ghost
Copy link
Author

ghost commented Oct 17, 2023

Then it is my fault, I wasn't even able to find where to put inputs. I am quite inexperienced with js.

I pasted the first readme example, and it seems to run, but with no output. Putting a console.log after the line with loadGTFS doesn't log anything.

it seems that I absolutely just don't know what I am doing.

@ghost ghost closed this as completed Oct 17, 2023
@piemadd
Copy link

piemadd commented Dec 1, 2023

I am having the same problem. Combing through the code and adding comments at key points, I seem to have narrowed down the issue to something with the gtfs-stream library not sending an end.

Image 1: My index.js
image

Image 2: Top of GTFSLoader.js
image

Image 3: Bottom of GTFSLoader.js
image

@piemadd
Copy link

piemadd commented Dec 1, 2023

Whoops, forgot to add this. The loader gets initialized, but never seems to resolve the promise.

image

@piemadd
Copy link

piemadd commented Dec 1, 2023

With even more testing, this is definitely a bug with gtfs-stream. Tried doing a test with this script:

const fs = require('fs');
const gtfs = require('gtfs-stream')

fs.createReadStream("gtfs.zip")
  .pipe(gtfs())
  .on('data', (entity) => {
    //console.log(entity)
  })
  .on('end', () => {
    console.log('end')
  })

And the program is exited without 'end' ever being logged. Heading over to that repo to file an issue now.

@linusnorton
Copy link
Contributor

I have the same issue on planarnetwork/gtfsmerge#11 - can you raise a reproducible error on gtfs-stream?

@linusnorton linusnorton reopened this Dec 1, 2023
@piemadd
Copy link

piemadd commented Dec 1, 2023

Doing some more poking around, it seems like gtfs-stream sends a finish event instead of an end event (what raptor is expecting). Doing this allowed the gtfs to load, but then immediately popped up another bug for me 🙃.

@linusnorton
Copy link
Contributor

There is a difference between finish and end but I can never remember what it is :)

It was definitely working with "end" so I wonder if there is an error that's not being surfaced and then it's closing with "finish".

@piemadd
Copy link

piemadd commented Dec 1, 2023

Yeah that's true. Lemme add in a listener for errors really quick then.

@piemadd
Copy link

piemadd commented Dec 1, 2023

Hmmmm, no errors seem to be passed down. Something is going wrong somewhere but nothing is logging that.

@piemadd
Copy link

piemadd commented Dec 1, 2023

Submitted an issue to gtfs-stream staeco/gtfs-stream#7

Now, there might be further issues with this, as poking through the code, it seems like the 4th item passed to RaptorAlgorithmFactory.create() is meant to be a Date() object, not the calendars.

@kostnerek
Copy link

Any clue what's wrong in RaptorAlgorithmFactory.create()? I'm coming to same conclusion as @piemadd, any tips how to fix this?

@matjamr
Copy link

matjamr commented Aug 29, 2024

Due to my observations calendars are not correctly processed, all calendar data is parsed into dates, hence broken matching for services, which results in further abominations. I will submit PR soon.

@matjamr
Copy link

matjamr commented Aug 29, 2024

Submitted an issue to gtfs-stream staeco/gtfs-stream#7

Now, there might be further issues with this, as poking through the code, it seems like the 4th item passed to RaptorAlgorithmFactory.create() is meant to be a Date() object, not the calendars.

It is mainly optional, which I assume, meant to accelerate search speed.

@kostnerek
Copy link

Wow nice @matjamr thank you, want to collaborate on fork/pr to resolve this issue?

@kostnerek
Copy link

Me and @kishieel are currently working on this maybe you want to join?

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

4 participants