1.0.1 • Published 9 months ago
jdf2gtfs v1.0.1
jdf2gtfs
a nodejs script and dependency to convert Czechoslovak JDF timetable format to GTFS
What is this?
A Dependency used by IsItHere to create GTFS feeds from JDF packaged timetables. This is a simple, db-less and customisable dependency.
Usage
const JDF2GTFS = require("jdf2gtfs")
const runner = new JDF2GTFS({
    path: "/Users/0charliecat/Github/jdf2gtfs/.temp/tdtn11122022",
    output: "/Users/0charliecat/Desktop/GTFS/tdtn11122022",
    locations: {},
    stop_codes: {},
    platforms: [{
        parent: "5000501",
        code: "A",
        location: [48.8748300, 18.0489801]
    }],
    timezone: "Europe/Bratislava",
    lang: "sk",
})
runner.make().then(()=>console.log("DONE!"))API
- the config - 
<JDF2GTFS>.constructor(e)pathstring REQUIRED - the path where JDF package is locatedoutputstring - the path where the GTFS Feed is exported - defaults topath/gtfsid_prefixstring - prefix for the ids used - defaults to empty stringlocationsobject REQUIRED - sets the longitude, latitude<stop_id>array REQUIRED - Number, Number
stop_codesobject - sets thestop_codeproperty of the stop<stop_id>string
platformsarray REQUIRED - adds platforms as stops- object
parentstring REQUIRED - Valid Parent stop idcodestring REQUIRED - platform number or codelocationarray REQUIRED - Number, Number
 
- object
 timezonestring - valid timezone id - defaults toEurope/Bratislavalangstring - valid language id - defaults toskline_number_changesobject - changes theLinky.number<route_id>string
line_colorsobject - sets the line colorsbackgroundstring - hex code of the colorforegroundstring - hex code of the color
line_networkobject - sets thenetwork_idproperty of the route<route_id>string - network id
yearsarray - years to create exeptions for national holidays (slovak)- Number - year
 
line_route_type_overrideobject - overrides JDF route types<route_id>Enum - Default GTFS Route Types or Google Extended GTFS (https://developers.google.com/transit/gtfs/reference/extended-route-types)
feed_publisher_namestring REQUIRED - feed publisher's namefeed_publisher_urlstring REQUIRED - feed publisher's urlstart_datestring - GTFS date of start of the feed - defaults to earliest timetable start of the linesend_datestring - gtfs date of the end of the feed - defaults to latest timetable start of the linesfeed_contact_emailstring - feed publisher's contact emailfeed_contact_urlstring - feed publisher's contact url
 - maker - 
<JDF2GTFS>.make()async function- makes the feed and writes it to the disk
 
 - Stops Generator - 
JDF2GTFS.Stops(config: <JDF2GTFS>)async function- generates the stops and returns Objects
 
 - Agency Generator - 
JDF2GTFS.Agencies((config: <JDF2GTFS>)async function- generates the agencies and returns Objects
 
 - Routes Generator - 
JDF2GTFS.Routes((config: <JDF2GTFS>)async function- generates the lines and returns Objects
 
 - Trips Generator - 
JDF2GTFS.Trips((config: <JDF2GTFS>)async function- generates the trips and returns Objects
 
 - Stop_Times Generator - 
JDF2GTFS.StopTimes((config: <JDF2GTFS>)async function- generates stop_times and returns objects
 
 - Calendar Generator - 
JDF2GTFS.Calendar((config: <JDF2GTFS>)async function- generates the calendar for services and returns objects
 
 - Calendar_Dates Generator - 
JDF2GTFS.CalendarDates((config: <JDF2GTFS>)async function- generates the calendar_dates and returns objects
 
 - Feed_Info Generator - 
JDF2GTFS.FeedInfo((config: <JDF2GTFS>)async function- generates feed info based on the config
 
 - classes 
JDF2GTFS.classes - enums 
JDF2GTFS.enums- JDF Pevny Kod Enums 
2.0.0-next-01
10 months ago
2.0.0-next-02
9 months ago
2.0.0-next-03
9 months ago
1.0.1
2 years ago
1.0.0
2 years ago