public-transport / gtfs-utils

Read & analyze GTFS datasets using Node.js.
https://github.com/public-transport/gtfs-utils#gtfs-utils
ISC License
36 stars 3 forks source link

Add route_id to the data structure used by computeSchedules #9

Closed karlsander closed 4 years ago

karlsander commented 5 years ago

Using this id as a signature (via custom computeSig) seems to work really well for me.

I'm not super familiar with gtfs so its possible that this approach is flawed in a way I'm missing.

derhuerst commented 5 years ago

A schedule as computed by computeSchedules is data derived from the GTFS. It therefore does not correspond 1-to-1 to a GTFS route (it may). Therefore we can't expose a single route_id as part of a schedule.

What we could do instead: Add a route_id field to each item in schedule.trips, because one trip has exactly one route associated.

derhuerst commented 4 years ago

@karlsander Are you interested in adapting this PR? I'd happily merge it then. 🙂

karlsander commented 4 years ago

So, this was a real drive by PR on my part. Sorry about that. I don't work with GTFS much and my memory of what I was even trying to do here is... limited.

I just pushed a commit with the suggested change (i think?) and it seems to work for the code I wrote for it (again, i think? But I think it's a flawed idea there?).

I have no real interest in getting it merged and I'm not qualified to say if its a good idea, so unless you think its very useful, probably close without merging.

karlsander commented 4 years ago

I didn't want to put any pressure on you saying i don't want it merged but then also submiting the patch, it was just kind of a fun puzzle that evening, so I'm closing this.