123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- TRAFFIC – Transport Related Adapted File Format, Improved and Corrected
- // heavly version!!
- // INDEXes in memory
- Stops:
- // may not be present
- // full in either partial or full timetable
- # DONE
- // INDEX: Trie by words in stop_name; non-letters mark segments, double non-letter are made single, non-letters are skipped, index is lower case, all segments-to-end start from root, (eg. Pl. Bernardyński -> root->plbernardyński, root->bernardyński)
- # DONE
- // INDEX2: by stop_code -> offset
- # TODO
- // INDEX3: by coordinates:
- // {
- // code: string // OLC to 175m
- // stops_offsets: []uint // offstet to Stops file (bytes)
- // neighbours_offset: [8]uint // offstet to self (bytes)
- // }
- // => binary search position in bucket -> get bucket + 1 iteration of neighbours -> get all stops
- // -> on next iteration get all neighbours; return only new stops
- {
- stop_code: string # DONE
- stop_name: string # DONE
- plates: string // "603 -> Garbary, 176 -> Garbary" # DONE
- zone: string # DONE
- position: string // OLC # DONE
- []struct { # DONE
- trip_offset: uint // offset in Trips file (bytes)
- stop_sequence: uint
- }
- }
- Trips:
- // may not be present
- // full in either partial or full timetable
- {
- headsign: string # DONE
- line_name: string # DONE
- modifications: string # DONE (non-standard)
- departures_offset: uint // offset in Departures file to first record in trip (bytes) # DONE
- scheduleID: string # DONE
- shape // TODO type-unknown
- }
- Calendar: # DONE
- // may not be present
- // full in either
- // exceptions THEN regular services
- // find first entry that matches startDate <= today <= endDate, check weekdays (it's 0xff for exceptions)
- // loaded to memory
- {
- scheduleID string # DONE
- weekdays uint8 // boolset 0=7=sunday; 1=monday # DONE
- startDate string // 19721231 #DONE
- endDate string // -"- # DONE
- }
- Departures: # DONE
- // may not be present
- // partial in partial timetable
- {
- trip_id: string # DONE
- stop_sequence: uint # DONE
- time: uint // minutes after 0000 # DONE
- pickup enum {regular, none, phone, driver} # DONE
- dropoff enum -"- # DONE
- }
- Lines:
- // may not be present
- // full in either partial or full timetable
- # TODO
- // Binary search by line_name
- {
- line_name: string # DONE
- graph: ? // TODO struct // contains trip_offset, stop_sequence for each stop in graph
- colour_text: uint # DONE
- colour_bg: uint # DONE
- }
- Vehicles
- // may not be present
- // full in either partial or full timetable
- Vehicle {
- id: string # DONE
- capabilites: u8 # FIXME
- }
- ---
- Favourite
- stop_code + line_name + headsign
- => search stop -> get trips -> filter by line_name + headsign
|