traffic.git

commit 0350bd6dc9308a1f71ab4c62032bca4c114a003f

Author: Adam <git@apiote.xyz>

use traffic structs from DSL

 traffic.bare | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++


diff --git a/traffic.bare b/traffic.bare
new file mode 100644
index 0000000000000000000000000000000000000000..44e68bbeb600e3f3bdb3b42ea3f212894b827511
--- /dev/null
+++ b/traffic.bare
@@ -0,0 +1,130 @@
+enum Direction {
+	THERE
+	BACK
+}
+
+
+type Trip {
+	id: string
+	headsign: string
+	direction: Direction
+	lineName: string
+	scheduleID: string
+	shapeID: string
+	departures: []Departure
+}
+
+type Vehicle {
+	id: string
+	capabilities: uint16  # bitmap
+}
+
+enum Boarding {
+	REGULAR
+	NONE
+	BY_PHONE
+	BY_DRIVER
+}
+
+type Departure {
+	stopSequence: int
+	time: uint  # seconds after 12h before noon
+	pickup: Boarding
+	dropoff: Boarding
+	stopOffset: uint
+}
+
+type Stop {
+	id: string
+	code: string
+	name: string
+	nodeName: string
+	changeOptions: []ChangeOption
+	zone: string  # ? optional
+	position: Position
+	order: map[string]StopOrder
+	timezone: string  # full timezone, e.g. Europe/London
+}
+
+type ChangeOption {
+	lineName: string
+	headsign: string
+}
+
+type Position {
+	lat: float64
+	lon: float64
+}
+
+type LineGraph {
+	stopCodes: []string
+	nextNodes: map[int][]int
+	prevNodes: map[int][]int
+}
+
+type StopOrder {
+	tripOffset: uint
+	sequence: int  # <- order
+	tripID: string  # ? needed
+}
+
+type Colour {
+	r: uint8
+	g: uint8
+	b: uint8
+	a: uint8
+}
+
+enum LineType {
+	TRAM
+	METRO
+	RAIL
+	BUS
+	FERRY
+	CABLE_TRAM
+	CABLE_CAR
+	FUNICULAR
+	TROLLEYBUS = 11
+	MONORAIL = 12
+}
+
+type Line {
+	id: string
+	name: string
+	colour: Colour  # <- go::color.RGBA
+	kind: LineType  # <- type
+	agencyID: string
+	graphThere: LineGraph
+	graphBack: LineGraph
+}
+
+type FeedInfo {
+	name: string
+	website: string
+	language: string  # make it IETF language tag
+}
+
+type Agency {
+	id: string
+	name: string
+	website: string
+	timezone: string  # as above
+	phoneNumber: string  # international phone number format
+	language: string  # as above
+	email: string
+	fareWebsite: string
+}
+
+type NameOffset {
+	name: string
+	offsets: []uint
+}
+
+type CodeIndex map[string]uint
+
+type Schedule {
+	id: string
+	weekdays: uint8  # bitmap: 0 and 7 is sunday
+	startDate: string  # yyyy-mm-dd
+	endDate: string  # yyyy-mm-dd
+}