node-gtfs icon indicating copy to clipboard operation
node-gtfs copied to clipboard

GTFS-RT Import does not apply the prefix.

Open ibaiway opened this issue 7 months ago • 5 comments

Hello,

As the title says the GTFS-RT import does not apply the prefix when it imports the data to the DB.

I am refering to the updateGtfsRealtime() function.

This causes problems because ids dont match between GTFS and GTFS-RT data if only one of them applies the prefix.

ibaiway avatar May 20 '25 17:05 ibaiway

Hi,

The updateGtfsRealtime function should be applying any prefixes specified in config.json.

Can you share with me your config.json that you are using?

brendannee avatar May 21 '25 05:05 brendannee

Sure, here it goes:

`import { Config } from "gtfs"

const gtfsConfig: Config = { sqlitePath: "./db/gtfs.db",

ignoreDuplicates: false, agencies: [ { url: "https://opendata.euskadi.eus/transport/moveuskadi/dbus/gtfs_dbus.zip", prefix: "dbus", realtimeTripUpdates: { url: "https://opendata.euskadi.eus/transport/moveuskadi/dbus/gtfsrt_dbus_trip_updates.pb", }, }, { url: "https://opendata.euskadi.eus/transport/moveuskadi/euskotren/gtfs_euskotren.zip", prefix: "euskotren", realtimeTripUpdates: { url: "https://opendata.euskadi.eus/transport/moveuskadi/euskotren/gtfsrt_euskotren_trip_updates.pb", }, }, ], }

export { gtfsConfig } `

Thank you for looking into this.

ibaiway avatar May 23 '25 13:05 ibaiway

Thanks for sharing.

Can you tell me which version of node-gifs you are using? If part of a project, check your node_modules/gtfs/package.json file to see what version is actually installed.

brendannee avatar May 25 '25 06:05 brendannee

Hi, sorry for the delay in my response.

I am using version 4.16.0

ibaiway avatar Jun 13 '25 08:06 ibaiway

Thanks!

This prefixing issue was fixed in node-gifs version 4.17.1. Try updating to the latest version and it should work as expected.

brendannee avatar Jun 14 '25 07:06 brendannee