diff --git a/gtfs/dev/build_st_extra.gleam b/gtfs/dev/build_st_extra.gleam index ce62429..8ac79e9 100644 --- a/gtfs/dev/build_st_extra.gleam +++ b/gtfs/dev/build_st_extra.gleam @@ -14,7 +14,7 @@ import gsv import shellout import simplifile -import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route.{type Route} import subway_gleam/gtfs/st_extra const data_file_path = "./MTA_Subway_Stations.csv" @@ -101,9 +101,8 @@ pub fn data() -> dict.Dict(StopId, Stop) { } fn output_stop(stop: st_extra.Stop) -> String { - let st_extra.Stop(id: st.StopId(id), borough:, daytime_routes:) = stop + let st_extra.Stop(id: id, borough:, daytime_routes:) = stop - let id = "StopId(\"" <> id <> "\")" let borough = case borough { st_extra.Manhattan -> "Manhattan" st_extra.Brooklyn -> "Brooklyn" @@ -117,33 +116,33 @@ fn output_stop(stop: st_extra.Stop) -> String { set.to_list(daytime_routes) |> list.map(fn(route) { case route { - st.N1 -> "N1" - st.N2 -> "N2" - st.N3 -> "N3" - st.N4 -> "N4" - st.N5 -> "N5" - st.N6 -> "N6" - st.N7 -> "N7" - st.A -> "A" - st.C -> "C" - st.E -> "E" - st.B -> "B" - st.D -> "D" - st.F -> "F" - st.M -> "M" - st.N -> "N" - st.Q -> "Q" - st.R -> "R" - st.W -> "W" - st.J -> "J" - st.Z -> "Z" - st.G -> "G" - st.L -> "L" - st.S -> "S" - st.Sr -> "Sr" - st.Sf -> "Sf" - st.Si -> "Si" - st.N6X | st.N7X | st.FX -> + route.N1 -> "N1" + route.N2 -> "N2" + route.N3 -> "N3" + route.N4 -> "N4" + route.N5 -> "N5" + route.N6 -> "N6" + route.N7 -> "N7" + route.A -> "A" + route.C -> "C" + route.E -> "E" + route.B -> "B" + route.D -> "D" + route.F -> "F" + route.M -> "M" + route.N -> "N" + route.Q -> "Q" + route.R -> "R" + route.W -> "W" + route.J -> "J" + route.Z -> "Z" + route.G -> "G" + route.L -> "L" + route.S -> "S" + route.Sr -> "Sr" + route.Sf -> "Sf" + route.Si -> "Si" + route.N6X | route.N7X | route.FX -> panic as "express routes not allowed in daytime routes" } }) @@ -156,7 +155,7 @@ fn output_stop(stop: st_extra.Stop) -> String { } fn stop_decoder() -> decode.Decoder(st_extra.Stop) { - use id <- decode.field("GTFS Stop ID", decode.string |> decode.map(st.StopId)) + use id <- decode.field("GTFS Stop ID", decode.string) use borough <- decode.field("Borough", borough_decoder()) use daytime_routes <- decode.field( "Daytime Routes", @@ -168,39 +167,39 @@ fn stop_decoder() -> decode.Decoder(st_extra.Stop) { fn daytime_routes_decoder( borough: st_extra.Borough, -) -> decode.Decoder(set.Set(st.Route)) { +) -> decode.Decoder(set.Set(Route)) { use routes <- decode.then(decode.string) routes |> string.split(on: " ") |> list.filter_map(fn(route) { case route { - "1" -> st.N1 |> Ok - "2" -> st.N2 |> Ok - "3" -> st.N3 |> Ok - "4" -> st.N4 |> Ok - "5" -> st.N5 |> Ok - "6" -> st.N6 |> Ok - "7" -> st.N7 |> Ok - "A" -> st.A |> Ok - "B" -> st.B |> Ok - "C" -> st.C |> Ok - "D" -> st.D |> Ok - "E" -> st.E |> Ok - "F" -> st.F |> Ok - "G" -> st.G |> Ok - "J" -> st.J |> Ok - "L" -> st.L |> Ok - "M" -> st.M |> Ok - "N" -> st.N |> Ok - "Q" -> st.Q |> Ok - "R" -> st.R |> Ok - "S" if borough == st_extra.Manhattan -> st.S |> Ok - "S" if borough == st_extra.Brooklyn -> st.Sf |> Ok - "S" if borough == st_extra.Queens -> st.Sr |> Ok - "W" -> st.W |> Ok - "Z" -> st.Z |> Ok - "SIR" -> st.Si |> Ok + "1" -> route.N1 |> Ok + "2" -> route.N2 |> Ok + "3" -> route.N3 |> Ok + "4" -> route.N4 |> Ok + "5" -> route.N5 |> Ok + "6" -> route.N6 |> Ok + "7" -> route.N7 |> Ok + "A" -> route.A |> Ok + "B" -> route.B |> Ok + "C" -> route.C |> Ok + "D" -> route.D |> Ok + "E" -> route.E |> Ok + "F" -> route.F |> Ok + "G" -> route.G |> Ok + "J" -> route.J |> Ok + "L" -> route.L |> Ok + "M" -> route.M |> Ok + "N" -> route.N |> Ok + "Q" -> route.Q |> Ok + "R" -> route.R |> Ok + "S" if borough == st_extra.Manhattan -> route.S |> Ok + "S" if borough == st_extra.Brooklyn -> route.Sf |> Ok + "S" if borough == st_extra.Queens -> route.Sr |> Ok + "W" -> route.W |> Ok + "Z" -> route.Z |> Ok + "SIR" -> route.Si |> Ok _ -> Error(Nil) } }) diff --git a/gtfs/src/subway_gleam/gtfs/rt.gleam b/gtfs/src/subway_gleam/gtfs/rt.gleam index 243b32e..b8ce20f 100644 --- a/gtfs/src/subway_gleam/gtfs/rt.gleam +++ b/gtfs/src/subway_gleam/gtfs/rt.gleam @@ -14,6 +14,7 @@ import subway_gleam/gtfs/internal/unix_time_to_timestamp.{unix_time_to_timestamp import subway_gleam/gtfs/rt/rich_text.{type RichText} import subway_gleam/gtfs/rt/time_range.{type TimeRange} import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route.{type Route} // TODO: find a better name pub type Data { @@ -297,7 +298,7 @@ fn parse_trip_update( } /// Extracts the routes of all trains in the arrivals list for a given stop. -pub fn routes_arriving(gtfs: Data, at stop: st.StopId) -> set.Set(st.Route) { +pub fn routes_arriving(gtfs: Data, at stop: st.StopId) -> set.Set(Route) { let arrivals = gtfs.arrivals |> dict.get(stop) @@ -305,7 +306,7 @@ pub fn routes_arriving(gtfs: Data, at stop: st.StopId) -> set.Set(st.Route) { list.fold(over: arrivals, from: set.new(), with: fn(acc, arrival) { let #(trip, _train_stopping) = arrival - case st.parse_route(trip.route) { + case route.parse(trip.route) { Ok(route) -> set.insert(route, into: acc) // If the route is unknown/invalid, don't bother adding it // This is best-effort @@ -314,13 +315,13 @@ pub fn routes_arriving(gtfs: Data, at stop: st.StopId) -> set.Set(st.Route) { }) } -pub fn routes_in_alert(alert: Alert) -> set.Set(st.Route) { +pub fn routes_in_alert(alert: Alert) -> set.Set(Route) { use acc, target <- list.fold(over: alert.targets, from: set.new()) let gtfs_rt_nyct.EntitySelector(route_id:, ..) = target let route_id = option.to_result(route_id, "") - case result.try(route_id, st.parse_route) { + case result.try(route_id, route.parse) { Ok(route) -> set.insert(route, into: acc) Error(_) -> acc } diff --git a/gtfs/src/subway_gleam/gtfs/st.gleam b/gtfs/src/subway_gleam/gtfs/st.gleam index 0911fb6..f642988 100644 --- a/gtfs/src/subway_gleam/gtfs/st.gleam +++ b/gtfs/src/subway_gleam/gtfs/st.gleam @@ -19,6 +19,7 @@ import gsv import subway_gleam/gtfs/internal/decode_parse_str_field.{decode_parse_str_field} import subway_gleam/gtfs/internal/ffi +import subway_gleam/gtfs/st/route.{type Route} pub type Feed { /// This file represents the "normal" subway schedule and does not include @@ -345,48 +346,6 @@ pub type Direction { South } -pub type Route { - N1 - N2 - N3 - - N4 - N5 - N6 - N6X - - N7 - N7X - - A - C - E - - B - D - F - FX - M - - N - Q - R - W - - J - Z - - G - - L - - S - Sr - Sf - - Si -} - pub type BulletShape { Circle Diamond @@ -394,33 +353,33 @@ pub type BulletShape { pub fn bullet_shape(for route: Route) -> BulletShape { case route { - N6X | N7X | FX -> Diamond - N1 - | N2 - | N3 - | N4 - | N5 - | N6 - | N7 - | A - | C - | E - | B - | D - | F - | M - | N - | Q - | R - | W - | J - | Z - | G - | L - | S - | Sr - | Sf - | Si -> Circle + route.N6X | route.N7X | route.FX -> Diamond + route.N1 + | route.N2 + | route.N3 + | route.N4 + | route.N5 + | route.N6 + | route.N7 + | route.A + | route.C + | route.E + | route.B + | route.D + | route.F + | route.M + | route.N + | route.Q + | route.R + | route.W + | route.J + | route.Z + | route.G + | route.L + | route.S + | route.Sr + | route.Sf + | route.Si -> Circle } } @@ -458,80 +417,6 @@ pub fn parse_stop_id_no_direction(from str: String) -> Result(StopId, Nil) { } } -/// This exists so that the app can convert Route <=> String losslessly. -/// It is essentially string.inspect. -/// It is the opposite of route_id_long_to_route(). -pub fn route_to_long_id(route: Route) -> String { - case route { - A -> "A" - B -> "B" - C -> "C" - D -> "D" - E -> "E" - F -> "F" - FX -> "FX" - G -> "G" - J -> "J" - L -> "L" - M -> "M" - N -> "N" - N1 -> "1" - N2 -> "2" - N3 -> "3" - N4 -> "4" - N5 -> "5" - N6 -> "6" - N6X -> "6X" - N7 -> "7" - N7X -> "7X" - Q -> "Q" - R -> "R" - S -> "S" - Sf -> "Sf" - Si -> "Si" - Sr -> "Sr" - W -> "W" - Z -> "Z" - } -} - -/// This exists so that the app can convert Route <=> String losslessly. -/// It is the opposite of route_to_long_id(). -pub fn route_id_long_to_route(route: String) -> Result(Route, Nil) { - case route { - "A" -> A |> Ok - "B" -> B |> Ok - "C" -> C |> Ok - "D" -> D |> Ok - "E" -> E |> Ok - "F" -> F |> Ok - "FX" -> FX |> Ok - "G" -> G |> Ok - "J" -> J |> Ok - "L" -> L |> Ok - "M" -> M |> Ok - "N" -> N |> Ok - "1" -> N1 |> Ok - "2" -> N2 |> Ok - "3" -> N3 |> Ok - "4" -> N4 |> Ok - "5" -> N5 |> Ok - "6" -> N6 |> Ok - "6X" -> N6X |> Ok - "7" -> N7 |> Ok - "7X" -> N7X |> Ok - "Q" -> Q |> Ok - "R" -> R |> Ok - "S" -> S |> Ok - "Sf" -> Sf |> Ok - "Si" -> Si |> Ok - "Sr" -> Sr |> Ok - "W" -> W |> Ok - "Z" -> Z |> Ok - _ -> Error(Nil) - } -} - pub fn direction_to_string(direction: option.Option(Direction)) -> String { case direction { option.None -> "" @@ -610,7 +495,7 @@ type Trip { fn trip_decoder() -> decode.Decoder(Trip) { use id <- decode.field("trip_id", decode.string) let id = TripId(id) - use route_id <- decode.field("route_id", route_decoder()) + use route_id <- decode.field("route_id", route.decoder()) use headsign <- decode.field("trip_headsign", decode.string) use shape_id <- decode.optional_field( "shape_id", @@ -620,50 +505,6 @@ fn trip_decoder() -> decode.Decoder(Trip) { decode.success(Trip(id:, route_id:, headsign:, shape_id:)) } -/// For parsing from GTFS -pub fn parse_route(route) { - case route { - "A" -> A |> Ok - "B" -> B |> Ok - "C" -> C |> Ok - "D" -> D |> Ok - "E" -> E |> Ok - "F" -> F |> Ok - "FX" -> FX |> Ok - "G" -> G |> Ok - "J" -> J |> Ok - "L" -> L |> Ok - "M" -> M |> Ok - "N" -> N |> Ok - "1" -> N1 |> Ok - "2" -> N2 |> Ok - "3" -> N3 |> Ok - "4" -> N4 |> Ok - "5" -> N5 |> Ok - "6" -> N6 |> Ok - "6X" -> N6X |> Ok - "7" -> N7 |> Ok - "7X" -> N7X |> Ok - "Q" -> Q |> Ok - "R" -> R |> Ok - "GS" -> S |> Ok - "FS" -> Sf |> Ok - "SI" -> Si |> Ok - "H" -> Sr |> Ok - "W" -> W |> Ok - "Z" -> Z |> Ok - route -> Error(route) - } -} - -fn route_decoder() -> decode.Decoder(Route) { - use route <- decode.then(decode.string) - case parse_route(route) { - Ok(route) -> decode.success(route) - Error(route) -> decode.failure(A, "Route (in trip) (" <> route <> ")") - } -} - pub opaque type ShapeId { ShapeId(String) } @@ -718,7 +559,7 @@ pub type RouteData { } fn route_data_decoder() -> decode.Decoder(RouteData) { - use id <- decode.field("route_id", route_decoder()) + use id <- decode.field("route_id", route.decoder()) use short_name <- decode.field("route_short_name", decode.string) use long_name <- decode.field("route_long_name", decode.string) use desc <- decode.field("route_desc", decode.string) diff --git a/gtfs/src/subway_gleam/gtfs/st/route.gleam b/gtfs/src/subway_gleam/gtfs/st/route.gleam new file mode 100644 index 0000000..491a0fc --- /dev/null +++ b/gtfs/src/subway_gleam/gtfs/st/route.gleam @@ -0,0 +1,161 @@ +import gleam/dynamic/decode + +pub type Route { + N1 + N2 + N3 + + N4 + N5 + N6 + N6X + + N7 + N7X + + A + C + E + + B + D + F + FX + M + + N + Q + R + W + + J + Z + + G + + L + + S + Sr + Sf + + Si +} + +pub fn decoder() -> decode.Decoder(Route) { + use route <- decode.then(decode.string) + case parse(route) { + Ok(route) -> decode.success(route) + Error(route) -> decode.failure(A, "Route (in trip) (" <> route <> ")") + } +} + +/// For parsing from GTFS +pub fn parse(route) { + case route { + "A" -> A |> Ok + "B" -> B |> Ok + "C" -> C |> Ok + "D" -> D |> Ok + "E" -> E |> Ok + "F" -> F |> Ok + "FX" -> FX |> Ok + "G" -> G |> Ok + "J" -> J |> Ok + "L" -> L |> Ok + "M" -> M |> Ok + "N" -> N |> Ok + "1" -> N1 |> Ok + "2" -> N2 |> Ok + "3" -> N3 |> Ok + "4" -> N4 |> Ok + "5" -> N5 |> Ok + "6" -> N6 |> Ok + "6X" -> N6X |> Ok + "7" -> N7 |> Ok + "7X" -> N7X |> Ok + "Q" -> Q |> Ok + "R" -> R |> Ok + "GS" -> S |> Ok + "FS" -> Sf |> Ok + "SI" -> Si |> Ok + "H" -> Sr |> Ok + "W" -> W |> Ok + "Z" -> Z |> Ok + route -> Error(route) + } +} + +/// This exists so that the app can convert Route <=> String losslessly. +/// It is essentially string.inspect. +/// It is the opposite of route_id_long_to_route(). +pub fn to_long_id(route: Route) -> String { + case route { + A -> "A" + B -> "B" + C -> "C" + D -> "D" + E -> "E" + F -> "F" + FX -> "FX" + G -> "G" + J -> "J" + L -> "L" + M -> "M" + N -> "N" + N1 -> "1" + N2 -> "2" + N3 -> "3" + N4 -> "4" + N5 -> "5" + N6 -> "6" + N6X -> "6X" + N7 -> "7" + N7X -> "7X" + Q -> "Q" + R -> "R" + S -> "S" + Sf -> "Sf" + Si -> "Si" + Sr -> "Sr" + W -> "W" + Z -> "Z" + } +} + +/// This exists so that the app can convert Route <=> String losslessly. +/// It is the opposite of route_to_long_id(). +pub fn from_long_id(route: String) -> Result(Route, Nil) { + case route { + "A" -> A |> Ok + "B" -> B |> Ok + "C" -> C |> Ok + "D" -> D |> Ok + "E" -> E |> Ok + "F" -> F |> Ok + "FX" -> FX |> Ok + "G" -> G |> Ok + "J" -> J |> Ok + "L" -> L |> Ok + "M" -> M |> Ok + "N" -> N |> Ok + "1" -> N1 |> Ok + "2" -> N2 |> Ok + "3" -> N3 |> Ok + "4" -> N4 |> Ok + "5" -> N5 |> Ok + "6" -> N6 |> Ok + "6X" -> N6X |> Ok + "7" -> N7 |> Ok + "7X" -> N7X |> Ok + "Q" -> Q |> Ok + "R" -> R |> Ok + "S" -> S |> Ok + "Sf" -> Sf |> Ok + "Si" -> Si |> Ok + "Sr" -> Sr |> Ok + "W" -> W |> Ok + "Z" -> Z |> Ok + _ -> Error(Nil) + } +} diff --git a/gtfs/src/subway_gleam/gtfs/st_extra.gleam b/gtfs/src/subway_gleam/gtfs/st_extra.gleam index 271e342..f1a5e8c 100644 --- a/gtfs/src/subway_gleam/gtfs/st_extra.gleam +++ b/gtfs/src/subway_gleam/gtfs/st_extra.gleam @@ -4,15 +4,15 @@ import gleam/set -import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route.{type Route} pub type Stop { Stop( - id: st.StopId, + id: String, borough: Borough, /// The routes that "normally" (ie, daytime weekdays) stop at the stop. /// Does not account for rush hour express. - daytime_routes: set.Set(st.Route), + daytime_routes: set.Set(Route), ) } diff --git a/gtfs/src/subway_gleam/gtfs/st_extra_data.gleam b/gtfs/src/subway_gleam/gtfs/st_extra_data.gleam index 6927ad0..cb9f098 100644 --- a/gtfs/src/subway_gleam/gtfs/st_extra_data.gleam +++ b/gtfs/src/subway_gleam/gtfs/st_extra_data.gleam @@ -1,511 +1,511 @@ import gleam/dict import gleam/set.{from_list as set} -import subway_gleam/gtfs/st.{ - type StopId, A, B, C, D, E, F, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N7, Q, R, - S, Sf, Si, Sr, StopId, W, Z, -} +import subway_gleam/gtfs/st/route.{ + +A, B, C, D, E, F, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N7, Q, R, + S, Sf, Si, Sr, W, Z,} import subway_gleam/gtfs/st_extra.{ type Stop, Bronx, Brooklyn, Manhattan, Queens, StatenIsland, Stop, } -pub fn data() -> dict.Dict(StopId, Stop) { +pub fn data() -> dict.Dict(String, Stop) { dict.from_list([ - #(StopId("127"), Stop(StopId("127"), Manhattan, set([N1, N2, N3]))), - #(StopId("S17"), Stop(StopId("S17"), StatenIsland, set([Si]))), - #(StopId("S01"), Stop(StopId("S01"), Brooklyn, set([Sf]))), - #(StopId("254"), Stop(StopId("254"), Brooklyn, set([N3]))), - #(StopId("M01"), Stop(StopId("M01"), Queens, set([M]))), - #(StopId("726"), Stop(StopId("726"), Manhattan, set([N7]))), - #(StopId("713"), Stop(StopId("713"), Queens, set([N7]))), - #(StopId("615"), Stop(StopId("615"), Bronx, set([N6]))), - #(StopId("M11"), Stop(StopId("M11"), Brooklyn, set([M, J, Z]))), - #(StopId("F16"), Stop(StopId("F16"), Manhattan, set([F]))), - #(StopId("F33"), Stop(StopId("F33"), Brooklyn, set([F]))), - #(StopId("233"), Stop(StopId("233"), Brooklyn, set([N2, N3]))), - #(StopId("M05"), Stop(StopId("M05"), Queens, set([M]))), - #(StopId("S30"), Stop(StopId("S30"), StatenIsland, set([Si]))), - #(StopId("R43"), Stop(StopId("R43"), Brooklyn, set([R]))), - #(StopId("A36"), Stop(StopId("A36"), Manhattan, set([C, A]))), - #(StopId("604"), Stop(StopId("604"), Bronx, set([N6]))), - #(StopId("D09"), Stop(StopId("D09"), Bronx, set([B, D]))), - #(StopId("629"), Stop(StopId("629"), Manhattan, set([N4, N5, N6]))), - #(StopId("219"), Stop(StopId("219"), Bronx, set([N2, N5]))), - #(StopId("F39"), Stop(StopId("F39"), Brooklyn, set([F]))), - #(StopId("N09"), Stop(StopId("N09"), Brooklyn, set([N]))), - #(StopId("610"), Stop(StopId("610"), Bronx, set([N6]))), - #(StopId("F32"), Stop(StopId("F32"), Brooklyn, set([F]))), - #(StopId("R13"), Stop(StopId("R13"), Manhattan, set([R, W, N]))), - #(StopId("B22"), Stop(StopId("B22"), Brooklyn, set([D]))), - #(StopId("622"), Stop(StopId("622"), Manhattan, set([N6]))), - #(StopId("H14"), Stop(StopId("H14"), Queens, set([A, Sr]))), - #(StopId("F05"), Stop(StopId("F05"), Queens, set([F, E]))), - #(StopId("R19"), Stop(StopId("R19"), Manhattan, set([R, W]))), - #(StopId("R18"), Stop(StopId("R18"), Manhattan, set([R, W]))), - #(StopId("114"), Stop(StopId("114"), Manhattan, set([N1]))), - #(StopId("A03"), Stop(StopId("A03"), Manhattan, set([A]))), - #(StopId("M16"), Stop(StopId("M16"), Brooklyn, set([M, J, Z]))), - #(StopId("720"), Stop(StopId("720"), Queens, set([N7]))), - #(StopId("A16"), Stop(StopId("A16"), Manhattan, set([C, B]))), - #(StopId("A41"), Stop(StopId("A41"), Brooklyn, set([C, F, A]))), - #(StopId("R39"), Stop(StopId("R39"), Brooklyn, set([R]))), - #(StopId("A52"), Stop(StopId("A52"), Brooklyn, set([C]))), - #(StopId("G34"), Stop(StopId("G34"), Brooklyn, set([G]))), - #(StopId("D30"), Stop(StopId("D30"), Brooklyn, set([Q]))), - #(StopId("G20"), Stop(StopId("G20"), Queens, set([M, R]))), - #(StopId("418"), Stop(StopId("418"), Manhattan, set([N4, N5]))), - #(StopId("212"), Stop(StopId("212"), Bronx, set([N2, N5]))), - #(StopId("503"), Stop(StopId("503"), Bronx, set([N5]))), - #(StopId("B18"), Stop(StopId("B18"), Brooklyn, set([D]))), - #(StopId("G29"), Stop(StopId("G29"), Brooklyn, set([G]))), - #(StopId("G21"), Stop(StopId("G21"), Queens, set([F, R, E]))), - #(StopId("406"), Stop(StopId("406"), Bronx, set([N4]))), - #(StopId("R23"), Stop(StopId("R23"), Manhattan, set([R, W]))), - #(StopId("110"), Stop(StopId("110"), Manhattan, set([N1]))), - #(StopId("G09"), Stop(StopId("G09"), Queens, set([M, R]))), - #(StopId("A51"), Stop(StopId("A51"), Brooklyn, set([C, A]))), - #(StopId("R01"), Stop(StopId("R01"), Queens, set([W, N]))), - #(StopId("246"), Stop(StopId("246"), Brooklyn, set([N2, N5]))), - #(StopId("L15"), Stop(StopId("L15"), Brooklyn, set([L]))), - #(StopId("725"), Stop(StopId("725"), Manhattan, set([N7]))), - #(StopId("S25"), Stop(StopId("S25"), StatenIsland, set([Si]))), - #(StopId("H01"), Stop(StopId("H01"), Queens, set([A]))), - #(StopId("J22"), Stop(StopId("J22"), Brooklyn, set([J]))), - #(StopId("A20"), Stop(StopId("A20"), Manhattan, set([C, B]))), - #(StopId("A57"), Stop(StopId("A57"), Brooklyn, set([A]))), - #(StopId("G15"), Stop(StopId("G15"), Queens, set([M, R]))), - #(StopId("D34"), Stop(StopId("D34"), Brooklyn, set([Q]))), - #(StopId("103"), Stop(StopId("103"), Bronx, set([N1]))), - #(StopId("238"), Stop(StopId("238"), Brooklyn, set([N2, N3]))), - #(StopId("637"), Stop(StopId("637"), Manhattan, set([N6]))), - #(StopId("D29"), Stop(StopId("D29"), Brooklyn, set([Q]))), - #(StopId("705"), Stop(StopId("705"), Queens, set([N7]))), - #(StopId("A15"), Stop(StopId("A15"), Manhattan, set([C, B, A, D]))), - #(StopId("D18"), Stop(StopId("D18"), Manhattan, set([M, F]))), - #(StopId("419"), Stop(StopId("419"), Manhattan, set([N4, N5]))), - #(StopId("N08"), Stop(StopId("N08"), Brooklyn, set([N]))), - #(StopId("115"), Stop(StopId("115"), Manhattan, set([N1]))), - #(StopId("226"), Stop(StopId("226"), Manhattan, set([N2, N3]))), - #(StopId("136"), Stop(StopId("136"), Manhattan, set([N1]))), - #(StopId("410"), Stop(StopId("410"), Bronx, set([N4]))), - #(StopId("D14"), Stop(StopId("D14"), Manhattan, set([B, D, E]))), - #(StopId("D08"), Stop(StopId("D08"), Bronx, set([B, D]))), - #(StopId("M20"), Stop(StopId("M20"), Manhattan, set([J, Z]))), - #(StopId("L10"), Stop(StopId("L10"), Brooklyn, set([L]))), - #(StopId("A30"), Stop(StopId("A30"), Manhattan, set([C, E]))), - #(StopId("A46"), Stop(StopId("A46"), Brooklyn, set([C, A]))), - #(StopId("N03"), Stop(StopId("N03"), Brooklyn, set([N]))), - #(StopId("504"), Stop(StopId("504"), Bronx, set([N5]))), - #(StopId("R06"), Stop(StopId("R06"), Queens, set([W, N]))), - #(StopId("D03"), Stop(StopId("D03"), Bronx, set([B, D]))), - #(StopId("619"), Stop(StopId("619"), Bronx, set([N6]))), - #(StopId("M10"), Stop(StopId("M10"), Brooklyn, set([M]))), - #(StopId("242"), Stop(StopId("242"), Brooklyn, set([N2, N5]))), - #(StopId("F22"), Stop(StopId("F22"), Brooklyn, set([F, G]))), - #(StopId("611"), Stop(StopId("611"), Bronx, set([N6]))), - #(StopId("Q05"), Stop(StopId("Q05"), Manhattan, set([Q]))), - #(StopId("229"), Stop(StopId("229"), Manhattan, set([N2, N3]))), - #(StopId("S29"), Stop(StopId("S29"), StatenIsland, set([Si]))), - #(StopId("M04"), Stop(StopId("M04"), Queens, set([M]))), - #(StopId("A10"), Stop(StopId("A10"), Manhattan, set([C]))), - #(StopId("R30"), Stop(StopId("R30"), Brooklyn, set([Q, B, R]))), - #(StopId("633"), Stop(StopId("633"), Manhattan, set([N6]))), - #(StopId("119"), Stop(StopId("119"), Manhattan, set([N1]))), - #(StopId("B04"), Stop(StopId("B04"), Queens, set([M]))), - #(StopId("204"), Stop(StopId("204"), Bronx, set([N2, N5]))), - #(StopId("J14"), Stop(StopId("J14"), Queens, set([J, Z]))), - #(StopId("L24"), Stop(StopId("L24"), Brooklyn, set([L]))), - #(StopId("R29"), Stop(StopId("R29"), Brooklyn, set([R]))), - #(StopId("234"), Stop(StopId("234"), Brooklyn, set([N2, N3, N4, N5]))), - #(StopId("L25"), Stop(StopId("L25"), Brooklyn, set([L]))), - #(StopId("D24"), Stop(StopId("D24"), Brooklyn, set([Q, B]))), - #(StopId("606"), Stop(StopId("606"), Bronx, set([N6]))), - #(StopId("F27"), Stop(StopId("F27"), Brooklyn, set([F, G]))), - #(StopId("D42"), Stop(StopId("D42"), Brooklyn, set([Q, F]))), - #(StopId("F34"), Stop(StopId("F34"), Brooklyn, set([F]))), - #(StopId("414"), Stop(StopId("414"), Bronx, set([N4]))), - #(StopId("301"), Stop(StopId("301"), Manhattan, set([N3]))), - #(StopId("132"), Stop(StopId("132"), Manhattan, set([N1, N2, N3]))), - #(StopId("H08"), Stop(StopId("H08"), Queens, set([A]))), - #(StopId("218"), Stop(StopId("218"), Bronx, set([N2, N5]))), - #(StopId("201"), Stop(StopId("201"), Bronx, set([N2]))), - #(StopId("F15"), Stop(StopId("F15"), Manhattan, set([F]))), - #(StopId("J13"), Stop(StopId("J13"), Queens, set([J]))), - #(StopId("F01"), Stop(StopId("F01"), Queens, set([F]))), - #(StopId("614"), Stop(StopId("614"), Bronx, set([N6]))), - #(StopId("118"), Stop(StopId("118"), Manhattan, set([N1]))), - #(StopId("R14"), Stop(StopId("R14"), Manhattan, set([Q, R, W, N]))), - #(StopId("607"), Stop(StopId("607"), Bronx, set([N6]))), - #(StopId("B21"), Stop(StopId("B21"), Brooklyn, set([D]))), - #(StopId("623"), Stop(StopId("623"), Manhattan, set([N6]))), - #(StopId("230"), Stop(StopId("230"), Manhattan, set([N2, N3]))), - #(StopId("H13"), Stop(StopId("H13"), Queens, set([A, Sr]))), - #(StopId("R15"), Stop(StopId("R15"), Manhattan, set([R, W, N]))), - #(StopId("D12"), Stop(StopId("D12"), Manhattan, set([B, D]))), - #(StopId("S16"), Stop(StopId("S16"), StatenIsland, set([Si]))), - #(StopId("255"), Stop(StopId("255"), Brooklyn, set([N3]))), - #(StopId("714"), Stop(StopId("714"), Queens, set([N7]))), - #(StopId("213"), Stop(StopId("213"), Bronx, set([N2, N5]))), - #(StopId("409"), Stop(StopId("409"), Bronx, set([N4]))), - #(StopId("Q04"), Stop(StopId("Q04"), Manhattan, set([Q]))), - #(StopId("F12"), Stop(StopId("F12"), Manhattan, set([F, E]))), - #(StopId("G30"), Stop(StopId("G30"), Brooklyn, set([G]))), - #(StopId("A24"), Stop(StopId("A24"), Manhattan, set([C, B, A, D]))), - #(StopId("R25"), Stop(StopId("R25"), Manhattan, set([R, W]))), - #(StopId("208"), Stop(StopId("208"), Bronx, set([N2, N5]))), - #(StopId("128"), Stop(StopId("128"), Manhattan, set([N1, N2, N3]))), - #(StopId("D38"), Stop(StopId("D38"), Brooklyn, set([Q]))), - #(StopId("A61"), Stop(StopId("A61"), Queens, set([A]))), - #(StopId("R42"), Stop(StopId("R42"), Brooklyn, set([R]))), - #(StopId("D43"), Stop(StopId("D43"), Brooklyn, set([Q, F, D, N]))), - #(StopId("628"), Stop(StopId("628"), Manhattan, set([N6]))), - #(StopId("G16"), Stop(StopId("G16"), Queens, set([M, R]))), - #(StopId("L29"), Stop(StopId("L29"), Brooklyn, set([L]))), - #(StopId("A31"), Stop(StopId("A31"), Manhattan, set([C, A, E]))), - #(StopId("G22"), Stop(StopId("G22"), Queens, set([G]))), - #(StopId("237"), Stop(StopId("237"), Brooklyn, set([N2, N3]))), - #(StopId("J31"), Stop(StopId("J31"), Brooklyn, set([J]))), - #(StopId("D19"), Stop(StopId("D19"), Manhattan, set([M, F]))), - #(StopId("M09"), Stop(StopId("M09"), Brooklyn, set([M]))), - #(StopId("618"), Stop(StopId("618"), Bronx, set([N6]))), - #(StopId("H02"), Stop(StopId("H02"), Queens, set([A]))), - #(StopId("S21"), Stop(StopId("S21"), StatenIsland, set([Si]))), - #(StopId("123"), Stop(StopId("123"), Manhattan, set([N1, N2, N3]))), - #(StopId("B17"), Stop(StopId("B17"), Brooklyn, set([D]))), - #(StopId("250"), Stop(StopId("250"), Brooklyn, set([N3, N4]))), - #(StopId("709"), Stop(StopId("709"), Queens, set([N7]))), - #(StopId("J23"), Stop(StopId("J23"), Brooklyn, set([J, Z]))), - #(StopId("L11"), Stop(StopId("L11"), Brooklyn, set([L]))), - #(StopId("J17"), Stop(StopId("J17"), Queens, set([J, Z]))), - #(StopId("702"), Stop(StopId("702"), Queens, set([N7]))), - #(StopId("638"), Stop(StopId("638"), Manhattan, set([N6]))), - #(StopId("B10"), Stop(StopId("B10"), Manhattan, set([M]))), - #(StopId("227"), Stop(StopId("227"), Manhattan, set([N2, N3]))), - #(StopId("A19"), Stop(StopId("A19"), Manhattan, set([C, B]))), - #(StopId("R36"), Stop(StopId("R36"), Brooklyn, set([R, D, N]))), - #(StopId("F04"), Stop(StopId("F04"), Queens, set([F]))), - #(StopId("A55"), Stop(StopId("A55"), Brooklyn, set([C, A]))), - #(StopId("R22"), Stop(StopId("R22"), Manhattan, set([R, W]))), - #(StopId("111"), Stop(StopId("111"), Manhattan, set([N1]))), - #(StopId("S26"), Stop(StopId("S26"), StatenIsland, set([Si]))), - #(StopId("A34"), Stop(StopId("A34"), Manhattan, set([C, A, E]))), - #(StopId("A02"), Stop(StopId("A02"), Manhattan, set([A]))), - #(StopId("D33"), Stop(StopId("D33"), Brooklyn, set([Q]))), - #(StopId("245"), Stop(StopId("245"), Brooklyn, set([N2, N5]))), - #(StopId("708"), Stop(StopId("708"), Queens, set([N7]))), - #(StopId("M14"), Stop(StopId("M14"), Brooklyn, set([M, J]))), - #(StopId("405"), Stop(StopId("405"), Bronx, set([N4]))), - #(StopId("L03"), Stop(StopId("L03"), Manhattan, set([L]))), - #(StopId("L14"), Stop(StopId("L14"), Brooklyn, set([L]))), - #(StopId("D15"), Stop(StopId("D15"), Manhattan, set([M, F, B, D]))), - #(StopId("719"), Stop(StopId("719"), Queens, set([N7]))), - #(StopId("135"), Stop(StopId("135"), Manhattan, set([N1]))), - #(StopId("A63"), Stop(StopId("A63"), Queens, set([A]))), - #(StopId("M21"), Stop(StopId("M21"), Manhattan, set([J, Z]))), - #(StopId("L05"), Stop(StopId("L05"), Manhattan, set([L]))), - #(StopId("D04"), Stop(StopId("D04"), Bronx, set([B, D]))), - #(StopId("249"), Stop(StopId("249"), Brooklyn, set([N3]))), - #(StopId("R26"), Stop(StopId("R26"), Manhattan, set([R, W]))), - #(StopId("J19"), Stop(StopId("J19"), Brooklyn, set([J]))), - #(StopId("A40"), Stop(StopId("A40"), Brooklyn, set([C, A]))), - #(StopId("G08"), Stop(StopId("G08"), Queens, set([M, F, R, E]))), - #(StopId("L20"), Stop(StopId("L20"), Brooklyn, set([L]))), - #(StopId("G33"), Stop(StopId("G33"), Brooklyn, set([G]))), - #(StopId("S11"), Stop(StopId("S11"), StatenIsland, set([Si]))), - #(StopId("L26"), Stop(StopId("L26"), Brooklyn, set([L]))), - #(StopId("131"), Stop(StopId("131"), Manhattan, set([N1]))), - #(StopId("L19"), Stop(StopId("L19"), Queens, set([L]))), - #(StopId("724"), Stop(StopId("724"), Manhattan, set([N7]))), - #(StopId("F21"), Stop(StopId("F21"), Brooklyn, set([F, G]))), - #(StopId("241"), Stop(StopId("241"), Brooklyn, set([N2, N5]))), - #(StopId("F29"), Stop(StopId("F29"), Brooklyn, set([F]))), - #(StopId("F35"), Stop(StopId("F35"), Brooklyn, set([F]))), - #(StopId("415"), Stop(StopId("415"), Bronx, set([N4]))), - #(StopId("S22"), Stop(StopId("S22"), StatenIsland, set([Si]))), - #(StopId("H07"), Stop(StopId("H07"), Queens, set([A]))), - #(StopId("222"), Stop(StopId("222"), Bronx, set([N2, N5]))), - #(StopId("R31"), Stop(StopId("R31"), Brooklyn, set([R, D, N]))), - #(StopId("209"), Stop(StopId("209"), Bronx, set([N2, N5]))), - #(StopId("D25"), Stop(StopId("D25"), Brooklyn, set([Q, B]))), - #(StopId("D39"), Stop(StopId("D39"), Brooklyn, set([Q, B]))), - #(StopId("B12"), Stop(StopId("B12"), Brooklyn, set([D]))), - #(StopId("A32"), Stop(StopId("A32"), Manhattan, set([C, A, E]))), - #(StopId("G07"), Stop(StopId("G07"), Queens, set([E]))), - #(StopId("G24"), Stop(StopId("G24"), Queens, set([G]))), - #(StopId("A11"), Stop(StopId("A11"), Manhattan, set([C]))), - #(StopId("413"), Stop(StopId("413"), Bronx, set([N4]))), - #(StopId("101"), Stop(StopId("101"), Bronx, set([N1]))), - #(StopId("A25"), Stop(StopId("A25"), Manhattan, set([C, E]))), - #(StopId("632"), Stop(StopId("632"), Manhattan, set([N6]))), - #(StopId("122"), Stop(StopId("122"), Manhattan, set([N1]))), - #(StopId("A47"), Stop(StopId("A47"), Brooklyn, set([C]))), - #(StopId("207"), Stop(StopId("207"), Bronx, set([N2, N5]))), - #(StopId("G12"), Stop(StopId("G12"), Queens, set([M, R]))), - #(StopId("N04"), Stop(StopId("N04"), Brooklyn, set([N]))), - #(StopId("A12"), Stop(StopId("A12"), Manhattan, set([C, A]))), - #(StopId("R05"), Stop(StopId("R05"), Queens, set([W, N]))), - #(StopId("A43"), Stop(StopId("A43"), Brooklyn, set([C]))), - #(StopId("D37"), Stop(StopId("D37"), Brooklyn, set([Q]))), - #(StopId("A60"), Stop(StopId("A60"), Queens, set([A]))), - #(StopId("R35"), Stop(StopId("R35"), Brooklyn, set([R]))), - #(StopId("G18"), Stop(StopId("G18"), Queens, set([M, R]))), - #(StopId("G36"), Stop(StopId("G36"), Brooklyn, set([G]))), - #(StopId("639"), Stop(StopId("639"), Manhattan, set([N6]))), - #(StopId("423"), Stop(StopId("423"), Brooklyn, set([N4, N5]))), - #(StopId("117"), Stop(StopId("117"), Manhattan, set([N1]))), - #(StopId("608"), Stop(StopId("608"), Bronx, set([N6]))), - #(StopId("634"), Stop(StopId("634"), Manhattan, set([N6]))), - #(StopId("H06"), Stop(StopId("H06"), Queens, set([A]))), - #(StopId("408"), Stop(StopId("408"), Bronx, set([N4]))), - #(StopId("F11"), Stop(StopId("F11"), Manhattan, set([F, E]))), - #(StopId("D26"), Stop(StopId("D26"), Brooklyn, set([Q, B, Sf]))), - #(StopId("129"), Stop(StopId("129"), Manhattan, set([N1]))), - #(StopId("R24"), Stop(StopId("R24"), Manhattan, set([R, W]))), - #(StopId("F07"), Stop(StopId("F07"), Queens, set([F, E]))), - #(StopId("N05"), Stop(StopId("N05"), Brooklyn, set([N]))), - #(StopId("R16"), Stop(StopId("R16"), Manhattan, set([Q, R, W, N]))), - #(StopId("112"), Stop(StopId("112"), Manhattan, set([N1]))), - #(StopId("302"), Stop(StopId("302"), Manhattan, set([N3]))), - #(StopId("A06"), Stop(StopId("A06"), Manhattan, set([A]))), - #(StopId("107"), Stop(StopId("107"), Manhattan, set([N1]))), - #(StopId("J30"), Stop(StopId("J30"), Brooklyn, set([J, Z]))), - #(StopId("715"), Stop(StopId("715"), Queens, set([N7]))), - #(StopId("F20"), Stop(StopId("F20"), Brooklyn, set([F, G]))), - #(StopId("A48"), Stop(StopId("A48"), Brooklyn, set([C, A]))), - #(StopId("Q03"), Stop(StopId("Q03"), Manhattan, set([Q]))), - #(StopId("231"), Stop(StopId("231"), Brooklyn, set([N2, N3]))), - #(StopId("A22"), Stop(StopId("A22"), Manhattan, set([C, B]))), - #(StopId("A54"), Stop(StopId("A54"), Brooklyn, set([C]))), - #(StopId("R41"), Stop(StopId("R41"), Brooklyn, set([R, N]))), - #(StopId("A38"), Stop(StopId("A38"), Manhattan, set([C, A]))), - #(StopId("602"), Stop(StopId("602"), Bronx, set([N6]))), - #(StopId("D11"), Stop(StopId("D11"), Bronx, set([B, D]))), - #(StopId("627"), Stop(StopId("627"), Manhattan, set([N6]))), - #(StopId("D32"), Stop(StopId("D32"), Brooklyn, set([Q]))), - #(StopId("139"), Stop(StopId("139"), Manhattan, set([N1]))), - #(StopId("R08"), Stop(StopId("R08"), Queens, set([W, N]))), - #(StopId("D21"), Stop(StopId("D21"), Manhattan, set([M, F, B, D]))), - #(StopId("S20"), Stop(StopId("S20"), StatenIsland, set([Si]))), - #(StopId("J12"), Stop(StopId("J12"), Queens, set([J, Z]))), - #(StopId("134"), Stop(StopId("134"), Manhattan, set([N1]))), - #(StopId("F02"), Stop(StopId("F02"), Queens, set([F]))), - #(StopId("F30"), Stop(StopId("F30"), Brooklyn, set([F]))), - #(StopId("501"), Stop(StopId("501"), Bronx, set([N5]))), - #(StopId("G31"), Stop(StopId("G31"), Brooklyn, set([G]))), - #(StopId("B16"), Stop(StopId("B16"), Brooklyn, set([D]))), - #(StopId("251"), Stop(StopId("251"), Brooklyn, set([N3]))), - #(StopId("214"), Stop(StopId("214"), Bronx, set([N2, N5]))), - #(StopId("624"), Stop(StopId("624"), Manhattan, set([N6]))), - #(StopId("H10"), Stop(StopId("H10"), Queens, set([A]))), - #(StopId("M22"), Stop(StopId("M22"), Manhattan, set([J, Z]))), - #(StopId("R21"), Stop(StopId("R21"), Manhattan, set([R, W]))), - #(StopId("L12"), Stop(StopId("L12"), Brooklyn, set([L]))), - #(StopId("902"), Stop(StopId("902"), Manhattan, set([S]))), - #(StopId("S15"), Stop(StopId("S15"), StatenIsland, set([Si]))), - #(StopId("256"), Stop(StopId("256"), Brooklyn, set([N3]))), - #(StopId("701"), Stop(StopId("701"), Queens, set([N7]))), - #(StopId("S04"), Stop(StopId("S04"), Brooklyn, set([Sf]))), - #(StopId("D05"), Stop(StopId("D05"), Bronx, set([B, D]))), - #(StopId("236"), Stop(StopId("236"), Brooklyn, set([N2, N3]))), - #(StopId("M08"), Stop(StopId("M08"), Brooklyn, set([M]))), - #(StopId("124"), Stop(StopId("124"), Manhattan, set([N1]))), - #(StopId("F24"), Stop(StopId("F24"), Brooklyn, set([F, G]))), - #(StopId("617"), Stop(StopId("617"), Bronx, set([N6]))), - #(StopId("A18"), Stop(StopId("A18"), Manhattan, set([C, B]))), - #(StopId("H03"), Stop(StopId("H03"), Queens, set([A]))), - #(StopId("244"), Stop(StopId("244"), Brooklyn, set([N2, N5]))), - #(StopId("710"), Stop(StopId("710"), Queens, set([N7]))), - #(StopId("J24"), Stop(StopId("J24"), Brooklyn, set([J, Z]))), - #(StopId("L21"), Stop(StopId("L21"), Brooklyn, set([L]))), - #(StopId("R32"), Stop(StopId("R32"), Brooklyn, set([R]))), - #(StopId("631"), Stop(StopId("631"), Manhattan, set([N4, N5, N6]))), - #(StopId("J16"), Stop(StopId("J16"), Queens, set([J]))), - #(StopId("B08"), Stop(StopId("B08"), Manhattan, set([Q, M]))), - #(StopId("R27"), Stop(StopId("R27"), Manhattan, set([R, W]))), - #(StopId("217"), Stop(StopId("217"), Bronx, set([N2, N5]))), - #(StopId("L27"), Stop(StopId("L27"), Brooklyn, set([L]))), - #(StopId("210"), Stop(StopId("210"), Bronx, set([N2, N5]))), - #(StopId("D16"), Stop(StopId("D16"), Manhattan, set([M, F, B, D]))), - #(StopId("F36"), Stop(StopId("F36"), Brooklyn, set([F]))), - #(StopId("416"), Stop(StopId("416"), Bronx, set([N4, N5]))), - #(StopId("B20"), Stop(StopId("B20"), Brooklyn, set([D]))), - #(StopId("B13"), Stop(StopId("B13"), Brooklyn, set([D]))), - #(StopId("F25"), Stop(StopId("F25"), Brooklyn, set([F, G]))), - #(StopId("138"), Stop(StopId("138"), Manhattan, set([N1]))), - #(StopId("D20"), Stop(StopId("D20"), Manhattan, set([M, F, B, D]))), - #(StopId("G26"), Stop(StopId("G26"), Brooklyn, set([G]))), - #(StopId("M18"), Stop(StopId("M18"), Manhattan, set([M, J, Z]))), - #(StopId("L06"), Stop(StopId("L06"), Manhattan, set([L]))), - #(StopId("D40"), Stop(StopId("D40"), Brooklyn, set([Q, B]))), - #(StopId("A27"), Stop(StopId("A27"), Manhattan, set([C, A, E]))), - #(StopId("R04"), Stop(StopId("R04"), Queens, set([W, N]))), - #(StopId("402"), Stop(StopId("402"), Bronx, set([N4]))), - #(StopId("H11"), Stop(StopId("H11"), Queens, set([A]))), - #(StopId("L02"), Stop(StopId("L02"), Manhattan, set([L]))), - #(StopId("601"), Stop(StopId("601"), Bronx, set([N6]))), - #(StopId("723"), Stop(StopId("723"), Manhattan, set([N7]))), - #(StopId("613"), Stop(StopId("613"), Bronx, set([N6]))), - #(StopId("S27"), Stop(StopId("S27"), StatenIsland, set([Si]))), - #(StopId("J20"), Stop(StopId("J20"), Brooklyn, set([J, Z]))), - #(StopId("A64"), Stop(StopId("A64"), Queens, set([A]))), - #(StopId("A07"), Stop(StopId("A07"), Manhattan, set([A]))), - #(StopId("106"), Stop(StopId("106"), Manhattan, set([N1]))), - #(StopId("121"), Stop(StopId("121"), Manhattan, set([N1]))), - #(StopId("206"), Stop(StopId("206"), Bronx, set([N2, N5]))), - #(StopId("G13"), Stop(StopId("G13"), Queens, set([M, R]))), - #(StopId("635"), Stop(StopId("635"), Manhattan, set([N4, N5, N6]))), - #(StopId("D13"), Stop(StopId("D13"), Manhattan, set([B, D]))), - #(StopId("D27"), Stop(StopId("D27"), Brooklyn, set([Q]))), - #(StopId("248"), Stop(StopId("248"), Brooklyn, set([N3]))), - #(StopId("707"), Stop(StopId("707"), Queens, set([N7]))), - #(StopId("R44"), Stop(StopId("R44"), Brooklyn, set([R]))), - #(StopId("412"), Stop(StopId("412"), Bronx, set([N4]))), - #(StopId("221"), Stop(StopId("221"), Bronx, set([N2, N5]))), - #(StopId("108"), Stop(StopId("108"), Manhattan, set([N1]))), - #(StopId("125"), Stop(StopId("125"), Manhattan, set([N1]))), - #(StopId("H04"), Stop(StopId("H04"), Queens, set([A, Sr]))), - #(StopId("A44"), Stop(StopId("A44"), Brooklyn, set([C]))), - #(StopId("A49"), Stop(StopId("A49"), Brooklyn, set([C]))), - #(StopId("711"), Stop(StopId("711"), Queens, set([N7]))), - #(StopId("B23"), Stop(StopId("B23"), Brooklyn, set([D]))), - #(StopId("G11"), Stop(StopId("G11"), Queens, set([M, R]))), - #(StopId("S09"), Stop(StopId("S09"), StatenIsland, set([Si]))), - #(StopId("J27"), Stop(StopId("J27"), Brooklyn, set([J, Z]))), - #(StopId("L17"), Stop(StopId("L17"), Brooklyn, set([L]))), - #(StopId("R09"), Stop(StopId("R09"), Queens, set([W, N]))), - #(StopId("M13"), Stop(StopId("M13"), Brooklyn, set([M, J]))), - #(StopId("S23"), Stop(StopId("S23"), StatenIsland, set([Si]))), - #(StopId("G06"), Stop(StopId("G06"), Queens, set([J, E, Z]))), - #(StopId("716"), Stop(StopId("716"), Queens, set([N7]))), - #(StopId("A17"), Stop(StopId("A17"), Manhattan, set([C, B]))), - #(StopId("F06"), Stop(StopId("F06"), Queens, set([F, E]))), - #(StopId("130"), Stop(StopId("130"), Manhattan, set([N1]))), - #(StopId("A42"), Stop(StopId("A42"), Brooklyn, set([C, A, G]))), - #(StopId("R20"), Stop(StopId("R20"), Manhattan, set([Q, R, W, N]))), - #(StopId("224"), Stop(StopId("224"), Manhattan, set([N2, N3]))), - #(StopId("N06"), Stop(StopId("N06"), Brooklyn, set([N]))), - #(StopId("A05"), Stop(StopId("A05"), Manhattan, set([A]))), - #(StopId("G35"), Stop(StopId("G35"), Brooklyn, set([G]))), - #(StopId("616"), Stop(StopId("616"), Bronx, set([N6]))), - #(StopId("J29"), Stop(StopId("J29"), Brooklyn, set([J]))), - #(StopId("D22"), Stop(StopId("D22"), Manhattan, set([B, D]))), - #(StopId("N10"), Stop(StopId("N10"), Brooklyn, set([N]))), - #(StopId("252"), Stop(StopId("252"), Brooklyn, set([N3]))), - #(StopId("S19"), Stop(StopId("S19"), StatenIsland, set([Si]))), - #(StopId("232"), Stop(StopId("232"), Brooklyn, set([N2, N3]))), - #(StopId("M06"), Stop(StopId("M06"), Queens, set([M]))), - #(StopId("H15"), Stop(StopId("H15"), Queens, set([A, Sr]))), - #(StopId("L13"), Stop(StopId("L13"), Brooklyn, set([L]))), - #(StopId("D10"), Stop(StopId("D10"), Bronx, set([B, D]))), - #(StopId("257"), Stop(StopId("257"), Brooklyn, set([N3]))), - #(StopId("S14"), Stop(StopId("S14"), StatenIsland, set([Si]))), - #(StopId("502"), Stop(StopId("502"), Bronx, set([N5]))), - #(StopId("G32"), Stop(StopId("G32"), Brooklyn, set([G]))), - #(StopId("215"), Stop(StopId("215"), Bronx, set([N2, N5]))), - #(StopId("F09"), Stop(StopId("F09"), Queens, set([F, E]))), - #(StopId("407"), Stop(StopId("407"), Bronx, set([N4]))), - #(StopId("A21"), Stop(StopId("A21"), Manhattan, set([C, B]))), - #(StopId("S31"), Stop(StopId("S31"), StatenIsland, set([Si]))), - #(StopId("Q01"), Stop(StopId("Q01"), Manhattan, set([Q, N]))), - #(StopId("A53"), Stop(StopId("A53"), Brooklyn, set([C]))), - #(StopId("113"), Stop(StopId("113"), Manhattan, set([N1]))), - #(StopId("603"), Stop(StopId("603"), Bronx, set([N6]))), - #(StopId("R34"), Stop(StopId("R34"), Brooklyn, set([R]))), - #(StopId("E01"), Stop(StopId("E01"), Manhattan, set([E]))), - #(StopId("S03"), Stop(StopId("S03"), Brooklyn, set([Sf]))), - #(StopId("D31"), Stop(StopId("D31"), Brooklyn, set([Q, B]))), - #(StopId("G19"), Stop(StopId("G19"), Queens, set([M, R]))), - #(StopId("F03"), Stop(StopId("F03"), Queens, set([F]))), - #(StopId("133"), Stop(StopId("133"), Manhattan, set([N1]))), - #(StopId("420"), Stop(StopId("420"), Manhattan, set([N4, N5]))), - #(StopId("609"), Stop(StopId("609"), Bronx, set([N6]))), - #(StopId("116"), Stop(StopId("116"), Manhattan, set([N1]))), - #(StopId("R11"), Stop(StopId("R11"), Manhattan, set([R, W, N]))), - #(StopId("F18"), Stop(StopId("F18"), Brooklyn, set([F]))), - #(StopId("F31"), Stop(StopId("F31"), Brooklyn, set([F]))), - #(StopId("B15"), Stop(StopId("B15"), Brooklyn, set([D]))), - #(StopId("H09"), Stop(StopId("H09"), Queens, set([A]))), - #(StopId("M23"), Stop(StopId("M23"), Manhattan, set([J, Z]))), - #(StopId("625"), Stop(StopId("625"), Manhattan, set([N6]))), - #(StopId("R17"), Stop(StopId("R17"), Manhattan, set([Q, R, W, N]))), - #(StopId("901"), Stop(StopId("901"), Manhattan, set([S]))), - #(StopId("142"), Stop(StopId("142"), Manhattan, set([N1]))), - #(StopId("D06"), Stop(StopId("D06"), Bronx, set([B, D]))), - #(StopId("640"), Stop(StopId("640"), Manhattan, set([N4, N5, N6]))), - #(StopId("A14"), Stop(StopId("A14"), Manhattan, set([C, B]))), - #(StopId("211"), Stop(StopId("211"), Bronx, set([N2, N5]))), - #(StopId("N07"), Stop(StopId("N07"), Brooklyn, set([N]))), - #(StopId("225"), Stop(StopId("225"), Manhattan, set([N2, N3]))), - #(StopId("B14"), Stop(StopId("B14"), Brooklyn, set([D]))), - #(StopId("R45"), Stop(StopId("R45"), Brooklyn, set([R]))), - #(StopId("G28"), Stop(StopId("G28"), Brooklyn, set([G]))), - #(StopId("A33"), Stop(StopId("A33"), Manhattan, set([C, E]))), - #(StopId("411"), Stop(StopId("411"), Bronx, set([N4]))), - #(StopId("A09"), Stop(StopId("A09"), Manhattan, set([C, A]))), - #(StopId("G05"), Stop(StopId("G05"), Queens, set([J, E, Z]))), - #(StopId("109"), Stop(StopId("109"), Manhattan, set([N1]))), - #(StopId("R40"), Stop(StopId("R40"), Brooklyn, set([R]))), - #(StopId("A59"), Stop(StopId("A59"), Queens, set([A]))), - #(StopId("A50"), Stop(StopId("A50"), Brooklyn, set([C]))), - #(StopId("G14"), Stop(StopId("G14"), Queens, set([M, F, R, E]))), - #(StopId("D35"), Stop(StopId("D35"), Brooklyn, set([Q, B]))), - #(StopId("626"), Stop(StopId("626"), Manhattan, set([N4, N5, N6]))), - #(StopId("R03"), Stop(StopId("R03"), Queens, set([W, N]))), - #(StopId("216"), Stop(StopId("216"), Bronx, set([N2, N5]))), - #(StopId("D01"), Stop(StopId("D01"), Bronx, set([D]))), - #(StopId("706"), Stop(StopId("706"), Queens, set([N7]))), - #(StopId("243"), Stop(StopId("243"), Brooklyn, set([N2, N5]))), - #(StopId("F23"), Stop(StopId("F23"), Brooklyn, set([F, G]))), - #(StopId("F26"), Stop(StopId("F26"), Brooklyn, set([F, G]))), - #(StopId("F38"), Stop(StopId("F38"), Brooklyn, set([F]))), - #(StopId("205"), Stop(StopId("205"), Bronx, set([N2, N5]))), - #(StopId("L16"), Stop(StopId("L16"), Brooklyn, set([L]))), - #(StopId("L28"), Stop(StopId("L28"), Brooklyn, set([L]))), - #(StopId("721"), Stop(StopId("721"), Queens, set([N7]))), - #(StopId("621"), Stop(StopId("621"), Manhattan, set([N4, N5, N6]))), - #(StopId("S24"), Stop(StopId("S24"), StatenIsland, set([Si]))), - #(StopId("137"), Stop(StopId("137"), Manhattan, set([N1, N2, N3]))), - #(StopId("A65"), Stop(StopId("A65"), Queens, set([A]))), - #(StopId("B19"), Stop(StopId("B19"), Brooklyn, set([D]))), - #(StopId("M19"), Stop(StopId("M19"), Manhattan, set([J, Z]))), - #(StopId("R33"), Stop(StopId("R33"), Brooklyn, set([R]))), - #(StopId("239"), Stop(StopId("239"), Brooklyn, set([N2, N3, N4, N5]))), - #(StopId("636"), Stop(StopId("636"), Manhattan, set([N6]))), - #(StopId("D28"), Stop(StopId("D28"), Brooklyn, set([Q, B]))), - #(StopId("R28"), Stop(StopId("R28"), Brooklyn, set([R]))), - #(StopId("J28"), Stop(StopId("J28"), Brooklyn, set([J, Z]))), - #(StopId("712"), Stop(StopId("712"), Queens, set([N7]))), - #(StopId("D41"), Stop(StopId("D41"), Brooklyn, set([Q]))), - #(StopId("J21"), Stop(StopId("J21"), Brooklyn, set([J, Z]))), - #(StopId("L22"), Stop(StopId("L22"), Brooklyn, set([L]))), - #(StopId("104"), Stop(StopId("104"), Bronx, set([N1]))), - #(StopId("G10"), Stop(StopId("G10"), Queens, set([M, R]))), - #(StopId("A28"), Stop(StopId("A28"), Manhattan, set([C, A, E]))), - #(StopId("H12"), Stop(StopId("H12"), Queens, set([A, Sr]))), - #(StopId("126"), Stop(StopId("126"), Manhattan, set([N1]))), - #(StopId("120"), Stop(StopId("120"), Manhattan, set([N1, N2, N3]))), - #(StopId("A45"), Stop(StopId("A45"), Brooklyn, set([C]))), - #(StopId("630"), Stop(StopId("630"), Manhattan, set([N6]))), - #(StopId("N02"), Stop(StopId("N02"), Brooklyn, set([N]))), - #(StopId("S13"), Stop(StopId("S13"), StatenIsland, set([Si]))), - #(StopId("235"), Stop(StopId("235"), Brooklyn, set([N2, N3, N4, N5]))), - #(StopId("247"), Stop(StopId("247"), Brooklyn, set([N2, N5]))), - #(StopId("401"), Stop(StopId("401"), Bronx, set([N4]))), - #(StopId("D17"), Stop(StopId("D17"), Manhattan, set([M, F, B, D]))), - #(StopId("505"), Stop(StopId("505"), Bronx, set([N5]))), - #(StopId("L01"), Stop(StopId("L01"), Manhattan, set([L]))), - #(StopId("718"), Stop(StopId("718"), Queens, set([N7]))), - #(StopId("612"), Stop(StopId("612"), Bronx, set([N6]))), - #(StopId("M12"), Stop(StopId("M12"), Brooklyn, set([M, J]))), - #(StopId("S28"), Stop(StopId("S28"), StatenIsland, set([Si]))), - #(StopId("228"), Stop(StopId("228"), Manhattan, set([N2, N3]))), - #(StopId("220"), Stop(StopId("220"), Bronx, set([N2, N5]))), - #(StopId("D07"), Stop(StopId("D07"), Bronx, set([B, D]))), - #(StopId("L08"), Stop(StopId("L08"), Brooklyn, set([L]))), - #(StopId("B06"), Stop(StopId("B06"), Manhattan, set([M]))), - #(StopId("J15"), Stop(StopId("J15"), Queens, set([J, Z]))), - #(StopId("S18"), Stop(StopId("S18"), StatenIsland, set([Si]))), - #(StopId("F14"), Stop(StopId("F14"), Manhattan, set([F]))), - #(StopId("253"), Stop(StopId("253"), Brooklyn, set([N3]))), + #("127", Stop("127", Manhattan, set([N1, N2, N3]))), + #("S17", Stop("S17", StatenIsland, set([Si]))), + #("S01", Stop("S01", Brooklyn, set([Sf]))), + #("254", Stop("254", Brooklyn, set([N3]))), + #("M01", Stop("M01", Queens, set([M]))), + #("726", Stop("726", Manhattan, set([N7]))), + #("713", Stop("713", Queens, set([N7]))), + #("615", Stop("615", Bronx, set([N6]))), + #("M11", Stop("M11", Brooklyn, set([M, J, Z]))), + #("F16", Stop("F16", Manhattan, set([F]))), + #("F33", Stop("F33", Brooklyn, set([F]))), + #("233", Stop("233", Brooklyn, set([N2, N3]))), + #("M05", Stop("M05", Queens, set([M]))), + #("S30", Stop("S30", StatenIsland, set([Si]))), + #("R43", Stop("R43", Brooklyn, set([R]))), + #("A36", Stop("A36", Manhattan, set([C, A]))), + #("604", Stop("604", Bronx, set([N6]))), + #("D09", Stop("D09", Bronx, set([B, D]))), + #("629", Stop("629", Manhattan, set([N4, N5, N6]))), + #("219", Stop("219", Bronx, set([N2, N5]))), + #("F39", Stop("F39", Brooklyn, set([F]))), + #("N09", Stop("N09", Brooklyn, set([N]))), + #("610", Stop("610", Bronx, set([N6]))), + #("F32", Stop("F32", Brooklyn, set([F]))), + #("R13", Stop("R13", Manhattan, set([R, W, N]))), + #("B22", Stop("B22", Brooklyn, set([D]))), + #("622", Stop("622", Manhattan, set([N6]))), + #("H14", Stop("H14", Queens, set([A, Sr]))), + #("F05", Stop("F05", Queens, set([F, E]))), + #("R19", Stop("R19", Manhattan, set([R, W]))), + #("R18", Stop("R18", Manhattan, set([R, W]))), + #("114", Stop("114", Manhattan, set([N1]))), + #("A03", Stop("A03", Manhattan, set([A]))), + #("M16", Stop("M16", Brooklyn, set([M, J, Z]))), + #("720", Stop("720", Queens, set([N7]))), + #("A16", Stop("A16", Manhattan, set([C, B]))), + #("A41", Stop("A41", Brooklyn, set([C, F, A]))), + #("R39", Stop("R39", Brooklyn, set([R]))), + #("A52", Stop("A52", Brooklyn, set([C]))), + #("G34", Stop("G34", Brooklyn, set([G]))), + #("D30", Stop("D30", Brooklyn, set([Q]))), + #("G20", Stop("G20", Queens, set([M, R]))), + #("418", Stop("418", Manhattan, set([N4, N5]))), + #("212", Stop("212", Bronx, set([N2, N5]))), + #("503", Stop("503", Bronx, set([N5]))), + #("B18", Stop("B18", Brooklyn, set([D]))), + #("G29", Stop("G29", Brooklyn, set([G]))), + #("G21", Stop("G21", Queens, set([F, R, E]))), + #("406", Stop("406", Bronx, set([N4]))), + #("R23", Stop("R23", Manhattan, set([R, W]))), + #("110", Stop("110", Manhattan, set([N1]))), + #("G09", Stop("G09", Queens, set([M, R]))), + #("A51", Stop("A51", Brooklyn, set([C, A]))), + #("R01", Stop("R01", Queens, set([W, N]))), + #("246", Stop("246", Brooklyn, set([N2, N5]))), + #("L15", Stop("L15", Brooklyn, set([L]))), + #("725", Stop("725", Manhattan, set([N7]))), + #("S25", Stop("S25", StatenIsland, set([Si]))), + #("H01", Stop("H01", Queens, set([A]))), + #("J22", Stop("J22", Brooklyn, set([J]))), + #("A20", Stop("A20", Manhattan, set([C, B]))), + #("A57", Stop("A57", Brooklyn, set([A]))), + #("G15", Stop("G15", Queens, set([M, R]))), + #("D34", Stop("D34", Brooklyn, set([Q]))), + #("103", Stop("103", Bronx, set([N1]))), + #("238", Stop("238", Brooklyn, set([N2, N3]))), + #("637", Stop("637", Manhattan, set([N6]))), + #("D29", Stop("D29", Brooklyn, set([Q]))), + #("705", Stop("705", Queens, set([N7]))), + #("A15", Stop("A15", Manhattan, set([C, B, A, D]))), + #("D18", Stop("D18", Manhattan, set([M, F]))), + #("419", Stop("419", Manhattan, set([N4, N5]))), + #("N08", Stop("N08", Brooklyn, set([N]))), + #("115", Stop("115", Manhattan, set([N1]))), + #("226", Stop("226", Manhattan, set([N2, N3]))), + #("136", Stop("136", Manhattan, set([N1]))), + #("410", Stop("410", Bronx, set([N4]))), + #("D14", Stop("D14", Manhattan, set([B, D, E]))), + #("D08", Stop("D08", Bronx, set([B, D]))), + #("M20", Stop("M20", Manhattan, set([J, Z]))), + #("L10", Stop("L10", Brooklyn, set([L]))), + #("A30", Stop("A30", Manhattan, set([C, E]))), + #("A46", Stop("A46", Brooklyn, set([C, A]))), + #("N03", Stop("N03", Brooklyn, set([N]))), + #("504", Stop("504", Bronx, set([N5]))), + #("R06", Stop("R06", Queens, set([W, N]))), + #("D03", Stop("D03", Bronx, set([B, D]))), + #("619", Stop("619", Bronx, set([N6]))), + #("M10", Stop("M10", Brooklyn, set([M]))), + #("242", Stop("242", Brooklyn, set([N2, N5]))), + #("F22", Stop("F22", Brooklyn, set([F, G]))), + #("611", Stop("611", Bronx, set([N6]))), + #("Q05", Stop("Q05", Manhattan, set([Q]))), + #("229", Stop("229", Manhattan, set([N2, N3]))), + #("S29", Stop("S29", StatenIsland, set([Si]))), + #("M04", Stop("M04", Queens, set([M]))), + #("A10", Stop("A10", Manhattan, set([C]))), + #("R30", Stop("R30", Brooklyn, set([Q, B, R]))), + #("633", Stop("633", Manhattan, set([N6]))), + #("119", Stop("119", Manhattan, set([N1]))), + #("B04", Stop("B04", Queens, set([M]))), + #("204", Stop("204", Bronx, set([N2, N5]))), + #("J14", Stop("J14", Queens, set([J, Z]))), + #("L24", Stop("L24", Brooklyn, set([L]))), + #("R29", Stop("R29", Brooklyn, set([R]))), + #("234", Stop("234", Brooklyn, set([N2, N3, N4, N5]))), + #("L25", Stop("L25", Brooklyn, set([L]))), + #("D24", Stop("D24", Brooklyn, set([Q, B]))), + #("606", Stop("606", Bronx, set([N6]))), + #("F27", Stop("F27", Brooklyn, set([F, G]))), + #("D42", Stop("D42", Brooklyn, set([Q, F]))), + #("F34", Stop("F34", Brooklyn, set([F]))), + #("414", Stop("414", Bronx, set([N4]))), + #("301", Stop("301", Manhattan, set([N3]))), + #("132", Stop("132", Manhattan, set([N1, N2, N3]))), + #("H08", Stop("H08", Queens, set([A]))), + #("218", Stop("218", Bronx, set([N2, N5]))), + #("201", Stop("201", Bronx, set([N2]))), + #("F15", Stop("F15", Manhattan, set([F]))), + #("J13", Stop("J13", Queens, set([J]))), + #("F01", Stop("F01", Queens, set([F]))), + #("614", Stop("614", Bronx, set([N6]))), + #("118", Stop("118", Manhattan, set([N1]))), + #("R14", Stop("R14", Manhattan, set([Q, R, W, N]))), + #("607", Stop("607", Bronx, set([N6]))), + #("B21", Stop("B21", Brooklyn, set([D]))), + #("623", Stop("623", Manhattan, set([N6]))), + #("230", Stop("230", Manhattan, set([N2, N3]))), + #("H13", Stop("H13", Queens, set([A, Sr]))), + #("R15", Stop("R15", Manhattan, set([R, W, N]))), + #("D12", Stop("D12", Manhattan, set([B, D]))), + #("S16", Stop("S16", StatenIsland, set([Si]))), + #("255", Stop("255", Brooklyn, set([N3]))), + #("714", Stop("714", Queens, set([N7]))), + #("213", Stop("213", Bronx, set([N2, N5]))), + #("409", Stop("409", Bronx, set([N4]))), + #("Q04", Stop("Q04", Manhattan, set([Q]))), + #("F12", Stop("F12", Manhattan, set([F, E]))), + #("G30", Stop("G30", Brooklyn, set([G]))), + #("A24", Stop("A24", Manhattan, set([C, B, A, D]))), + #("R25", Stop("R25", Manhattan, set([R, W]))), + #("208", Stop("208", Bronx, set([N2, N5]))), + #("128", Stop("128", Manhattan, set([N1, N2, N3]))), + #("D38", Stop("D38", Brooklyn, set([Q]))), + #("A61", Stop("A61", Queens, set([A]))), + #("R42", Stop("R42", Brooklyn, set([R]))), + #("D43", Stop("D43", Brooklyn, set([Q, F, D, N]))), + #("628", Stop("628", Manhattan, set([N6]))), + #("G16", Stop("G16", Queens, set([M, R]))), + #("L29", Stop("L29", Brooklyn, set([L]))), + #("A31", Stop("A31", Manhattan, set([C, A, E]))), + #("G22", Stop("G22", Queens, set([G]))), + #("237", Stop("237", Brooklyn, set([N2, N3]))), + #("J31", Stop("J31", Brooklyn, set([J]))), + #("D19", Stop("D19", Manhattan, set([M, F]))), + #("M09", Stop("M09", Brooklyn, set([M]))), + #("618", Stop("618", Bronx, set([N6]))), + #("H02", Stop("H02", Queens, set([A]))), + #("S21", Stop("S21", StatenIsland, set([Si]))), + #("123", Stop("123", Manhattan, set([N1, N2, N3]))), + #("B17", Stop("B17", Brooklyn, set([D]))), + #("250", Stop("250", Brooklyn, set([N3, N4]))), + #("709", Stop("709", Queens, set([N7]))), + #("J23", Stop("J23", Brooklyn, set([J, Z]))), + #("L11", Stop("L11", Brooklyn, set([L]))), + #("J17", Stop("J17", Queens, set([J, Z]))), + #("702", Stop("702", Queens, set([N7]))), + #("638", Stop("638", Manhattan, set([N6]))), + #("B10", Stop("B10", Manhattan, set([M]))), + #("227", Stop("227", Manhattan, set([N2, N3]))), + #("A19", Stop("A19", Manhattan, set([C, B]))), + #("R36", Stop("R36", Brooklyn, set([R, D, N]))), + #("F04", Stop("F04", Queens, set([F]))), + #("A55", Stop("A55", Brooklyn, set([C, A]))), + #("R22", Stop("R22", Manhattan, set([R, W]))), + #("111", Stop("111", Manhattan, set([N1]))), + #("S26", Stop("S26", StatenIsland, set([Si]))), + #("A34", Stop("A34", Manhattan, set([C, A, E]))), + #("A02", Stop("A02", Manhattan, set([A]))), + #("D33", Stop("D33", Brooklyn, set([Q]))), + #("245", Stop("245", Brooklyn, set([N2, N5]))), + #("708", Stop("708", Queens, set([N7]))), + #("M14", Stop("M14", Brooklyn, set([M, J]))), + #("405", Stop("405", Bronx, set([N4]))), + #("L03", Stop("L03", Manhattan, set([L]))), + #("L14", Stop("L14", Brooklyn, set([L]))), + #("D15", Stop("D15", Manhattan, set([M, F, B, D]))), + #("719", Stop("719", Queens, set([N7]))), + #("135", Stop("135", Manhattan, set([N1]))), + #("A63", Stop("A63", Queens, set([A]))), + #("M21", Stop("M21", Manhattan, set([J, Z]))), + #("L05", Stop("L05", Manhattan, set([L]))), + #("D04", Stop("D04", Bronx, set([B, D]))), + #("249", Stop("249", Brooklyn, set([N3]))), + #("R26", Stop("R26", Manhattan, set([R, W]))), + #("J19", Stop("J19", Brooklyn, set([J]))), + #("A40", Stop("A40", Brooklyn, set([C, A]))), + #("G08", Stop("G08", Queens, set([M, F, R, E]))), + #("L20", Stop("L20", Brooklyn, set([L]))), + #("G33", Stop("G33", Brooklyn, set([G]))), + #("S11", Stop("S11", StatenIsland, set([Si]))), + #("L26", Stop("L26", Brooklyn, set([L]))), + #("131", Stop("131", Manhattan, set([N1]))), + #("L19", Stop("L19", Queens, set([L]))), + #("724", Stop("724", Manhattan, set([N7]))), + #("F21", Stop("F21", Brooklyn, set([F, G]))), + #("241", Stop("241", Brooklyn, set([N2, N5]))), + #("F29", Stop("F29", Brooklyn, set([F]))), + #("F35", Stop("F35", Brooklyn, set([F]))), + #("415", Stop("415", Bronx, set([N4]))), + #("S22", Stop("S22", StatenIsland, set([Si]))), + #("H07", Stop("H07", Queens, set([A]))), + #("222", Stop("222", Bronx, set([N2, N5]))), + #("R31", Stop("R31", Brooklyn, set([R, D, N]))), + #("209", Stop("209", Bronx, set([N2, N5]))), + #("D25", Stop("D25", Brooklyn, set([Q, B]))), + #("D39", Stop("D39", Brooklyn, set([Q, B]))), + #("B12", Stop("B12", Brooklyn, set([D]))), + #("A32", Stop("A32", Manhattan, set([C, A, E]))), + #("G07", Stop("G07", Queens, set([E]))), + #("G24", Stop("G24", Queens, set([G]))), + #("A11", Stop("A11", Manhattan, set([C]))), + #("413", Stop("413", Bronx, set([N4]))), + #("101", Stop("101", Bronx, set([N1]))), + #("A25", Stop("A25", Manhattan, set([C, E]))), + #("632", Stop("632", Manhattan, set([N6]))), + #("122", Stop("122", Manhattan, set([N1]))), + #("A47", Stop("A47", Brooklyn, set([C]))), + #("207", Stop("207", Bronx, set([N2, N5]))), + #("G12", Stop("G12", Queens, set([M, R]))), + #("N04", Stop("N04", Brooklyn, set([N]))), + #("A12", Stop("A12", Manhattan, set([C, A]))), + #("R05", Stop("R05", Queens, set([W, N]))), + #("A43", Stop("A43", Brooklyn, set([C]))), + #("D37", Stop("D37", Brooklyn, set([Q]))), + #("A60", Stop("A60", Queens, set([A]))), + #("R35", Stop("R35", Brooklyn, set([R]))), + #("G18", Stop("G18", Queens, set([M, R]))), + #("G36", Stop("G36", Brooklyn, set([G]))), + #("639", Stop("639", Manhattan, set([N6]))), + #("423", Stop("423", Brooklyn, set([N4, N5]))), + #("117", Stop("117", Manhattan, set([N1]))), + #("608", Stop("608", Bronx, set([N6]))), + #("634", Stop("634", Manhattan, set([N6]))), + #("H06", Stop("H06", Queens, set([A]))), + #("408", Stop("408", Bronx, set([N4]))), + #("F11", Stop("F11", Manhattan, set([F, E]))), + #("D26", Stop("D26", Brooklyn, set([Q, B, Sf]))), + #("129", Stop("129", Manhattan, set([N1]))), + #("R24", Stop("R24", Manhattan, set([R, W]))), + #("F07", Stop("F07", Queens, set([F, E]))), + #("N05", Stop("N05", Brooklyn, set([N]))), + #("R16", Stop("R16", Manhattan, set([Q, R, W, N]))), + #("112", Stop("112", Manhattan, set([N1]))), + #("302", Stop("302", Manhattan, set([N3]))), + #("A06", Stop("A06", Manhattan, set([A]))), + #("107", Stop("107", Manhattan, set([N1]))), + #("J30", Stop("J30", Brooklyn, set([J, Z]))), + #("715", Stop("715", Queens, set([N7]))), + #("F20", Stop("F20", Brooklyn, set([F, G]))), + #("A48", Stop("A48", Brooklyn, set([C, A]))), + #("Q03", Stop("Q03", Manhattan, set([Q]))), + #("231", Stop("231", Brooklyn, set([N2, N3]))), + #("A22", Stop("A22", Manhattan, set([C, B]))), + #("A54", Stop("A54", Brooklyn, set([C]))), + #("R41", Stop("R41", Brooklyn, set([R, N]))), + #("A38", Stop("A38", Manhattan, set([C, A]))), + #("602", Stop("602", Bronx, set([N6]))), + #("D11", Stop("D11", Bronx, set([B, D]))), + #("627", Stop("627", Manhattan, set([N6]))), + #("D32", Stop("D32", Brooklyn, set([Q]))), + #("139", Stop("139", Manhattan, set([N1]))), + #("R08", Stop("R08", Queens, set([W, N]))), + #("D21", Stop("D21", Manhattan, set([M, F, B, D]))), + #("S20", Stop("S20", StatenIsland, set([Si]))), + #("J12", Stop("J12", Queens, set([J, Z]))), + #("134", Stop("134", Manhattan, set([N1]))), + #("F02", Stop("F02", Queens, set([F]))), + #("F30", Stop("F30", Brooklyn, set([F]))), + #("501", Stop("501", Bronx, set([N5]))), + #("G31", Stop("G31", Brooklyn, set([G]))), + #("B16", Stop("B16", Brooklyn, set([D]))), + #("251", Stop("251", Brooklyn, set([N3]))), + #("214", Stop("214", Bronx, set([N2, N5]))), + #("624", Stop("624", Manhattan, set([N6]))), + #("H10", Stop("H10", Queens, set([A]))), + #("M22", Stop("M22", Manhattan, set([J, Z]))), + #("R21", Stop("R21", Manhattan, set([R, W]))), + #("L12", Stop("L12", Brooklyn, set([L]))), + #("902", Stop("902", Manhattan, set([S]))), + #("S15", Stop("S15", StatenIsland, set([Si]))), + #("256", Stop("256", Brooklyn, set([N3]))), + #("701", Stop("701", Queens, set([N7]))), + #("S04", Stop("S04", Brooklyn, set([Sf]))), + #("D05", Stop("D05", Bronx, set([B, D]))), + #("236", Stop("236", Brooklyn, set([N2, N3]))), + #("M08", Stop("M08", Brooklyn, set([M]))), + #("124", Stop("124", Manhattan, set([N1]))), + #("F24", Stop("F24", Brooklyn, set([F, G]))), + #("617", Stop("617", Bronx, set([N6]))), + #("A18", Stop("A18", Manhattan, set([C, B]))), + #("H03", Stop("H03", Queens, set([A]))), + #("244", Stop("244", Brooklyn, set([N2, N5]))), + #("710", Stop("710", Queens, set([N7]))), + #("J24", Stop("J24", Brooklyn, set([J, Z]))), + #("L21", Stop("L21", Brooklyn, set([L]))), + #("R32", Stop("R32", Brooklyn, set([R]))), + #("631", Stop("631", Manhattan, set([N4, N5, N6]))), + #("J16", Stop("J16", Queens, set([J]))), + #("B08", Stop("B08", Manhattan, set([Q, M]))), + #("R27", Stop("R27", Manhattan, set([R, W]))), + #("217", Stop("217", Bronx, set([N2, N5]))), + #("L27", Stop("L27", Brooklyn, set([L]))), + #("210", Stop("210", Bronx, set([N2, N5]))), + #("D16", Stop("D16", Manhattan, set([M, F, B, D]))), + #("F36", Stop("F36", Brooklyn, set([F]))), + #("416", Stop("416", Bronx, set([N4, N5]))), + #("B20", Stop("B20", Brooklyn, set([D]))), + #("B13", Stop("B13", Brooklyn, set([D]))), + #("F25", Stop("F25", Brooklyn, set([F, G]))), + #("138", Stop("138", Manhattan, set([N1]))), + #("D20", Stop("D20", Manhattan, set([M, F, B, D]))), + #("G26", Stop("G26", Brooklyn, set([G]))), + #("M18", Stop("M18", Manhattan, set([M, J, Z]))), + #("L06", Stop("L06", Manhattan, set([L]))), + #("D40", Stop("D40", Brooklyn, set([Q, B]))), + #("A27", Stop("A27", Manhattan, set([C, A, E]))), + #("R04", Stop("R04", Queens, set([W, N]))), + #("402", Stop("402", Bronx, set([N4]))), + #("H11", Stop("H11", Queens, set([A]))), + #("L02", Stop("L02", Manhattan, set([L]))), + #("601", Stop("601", Bronx, set([N6]))), + #("723", Stop("723", Manhattan, set([N7]))), + #("613", Stop("613", Bronx, set([N6]))), + #("S27", Stop("S27", StatenIsland, set([Si]))), + #("J20", Stop("J20", Brooklyn, set([J, Z]))), + #("A64", Stop("A64", Queens, set([A]))), + #("A07", Stop("A07", Manhattan, set([A]))), + #("106", Stop("106", Manhattan, set([N1]))), + #("121", Stop("121", Manhattan, set([N1]))), + #("206", Stop("206", Bronx, set([N2, N5]))), + #("G13", Stop("G13", Queens, set([M, R]))), + #("635", Stop("635", Manhattan, set([N4, N5, N6]))), + #("D13", Stop("D13", Manhattan, set([B, D]))), + #("D27", Stop("D27", Brooklyn, set([Q]))), + #("248", Stop("248", Brooklyn, set([N3]))), + #("707", Stop("707", Queens, set([N7]))), + #("R44", Stop("R44", Brooklyn, set([R]))), + #("412", Stop("412", Bronx, set([N4]))), + #("221", Stop("221", Bronx, set([N2, N5]))), + #("108", Stop("108", Manhattan, set([N1]))), + #("125", Stop("125", Manhattan, set([N1]))), + #("H04", Stop("H04", Queens, set([A, Sr]))), + #("A44", Stop("A44", Brooklyn, set([C]))), + #("A49", Stop("A49", Brooklyn, set([C]))), + #("711", Stop("711", Queens, set([N7]))), + #("B23", Stop("B23", Brooklyn, set([D]))), + #("G11", Stop("G11", Queens, set([M, R]))), + #("S09", Stop("S09", StatenIsland, set([Si]))), + #("J27", Stop("J27", Brooklyn, set([J, Z]))), + #("L17", Stop("L17", Brooklyn, set([L]))), + #("R09", Stop("R09", Queens, set([W, N]))), + #("M13", Stop("M13", Brooklyn, set([M, J]))), + #("S23", Stop("S23", StatenIsland, set([Si]))), + #("G06", Stop("G06", Queens, set([J, E, Z]))), + #("716", Stop("716", Queens, set([N7]))), + #("A17", Stop("A17", Manhattan, set([C, B]))), + #("F06", Stop("F06", Queens, set([F, E]))), + #("130", Stop("130", Manhattan, set([N1]))), + #("A42", Stop("A42", Brooklyn, set([C, A, G]))), + #("R20", Stop("R20", Manhattan, set([Q, R, W, N]))), + #("224", Stop("224", Manhattan, set([N2, N3]))), + #("N06", Stop("N06", Brooklyn, set([N]))), + #("A05", Stop("A05", Manhattan, set([A]))), + #("G35", Stop("G35", Brooklyn, set([G]))), + #("616", Stop("616", Bronx, set([N6]))), + #("J29", Stop("J29", Brooklyn, set([J]))), + #("D22", Stop("D22", Manhattan, set([B, D]))), + #("N10", Stop("N10", Brooklyn, set([N]))), + #("252", Stop("252", Brooklyn, set([N3]))), + #("S19", Stop("S19", StatenIsland, set([Si]))), + #("232", Stop("232", Brooklyn, set([N2, N3]))), + #("M06", Stop("M06", Queens, set([M]))), + #("H15", Stop("H15", Queens, set([A, Sr]))), + #("L13", Stop("L13", Brooklyn, set([L]))), + #("D10", Stop("D10", Bronx, set([B, D]))), + #("257", Stop("257", Brooklyn, set([N3]))), + #("S14", Stop("S14", StatenIsland, set([Si]))), + #("502", Stop("502", Bronx, set([N5]))), + #("G32", Stop("G32", Brooklyn, set([G]))), + #("215", Stop("215", Bronx, set([N2, N5]))), + #("F09", Stop("F09", Queens, set([F, E]))), + #("407", Stop("407", Bronx, set([N4]))), + #("A21", Stop("A21", Manhattan, set([C, B]))), + #("S31", Stop("S31", StatenIsland, set([Si]))), + #("Q01", Stop("Q01", Manhattan, set([Q, N]))), + #("A53", Stop("A53", Brooklyn, set([C]))), + #("113", Stop("113", Manhattan, set([N1]))), + #("603", Stop("603", Bronx, set([N6]))), + #("R34", Stop("R34", Brooklyn, set([R]))), + #("E01", Stop("E01", Manhattan, set([E]))), + #("S03", Stop("S03", Brooklyn, set([Sf]))), + #("D31", Stop("D31", Brooklyn, set([Q, B]))), + #("G19", Stop("G19", Queens, set([M, R]))), + #("F03", Stop("F03", Queens, set([F]))), + #("133", Stop("133", Manhattan, set([N1]))), + #("420", Stop("420", Manhattan, set([N4, N5]))), + #("609", Stop("609", Bronx, set([N6]))), + #("116", Stop("116", Manhattan, set([N1]))), + #("R11", Stop("R11", Manhattan, set([R, W, N]))), + #("F18", Stop("F18", Brooklyn, set([F]))), + #("F31", Stop("F31", Brooklyn, set([F]))), + #("B15", Stop("B15", Brooklyn, set([D]))), + #("H09", Stop("H09", Queens, set([A]))), + #("M23", Stop("M23", Manhattan, set([J, Z]))), + #("625", Stop("625", Manhattan, set([N6]))), + #("R17", Stop("R17", Manhattan, set([Q, R, W, N]))), + #("901", Stop("901", Manhattan, set([S]))), + #("142", Stop("142", Manhattan, set([N1]))), + #("D06", Stop("D06", Bronx, set([B, D]))), + #("640", Stop("640", Manhattan, set([N4, N5, N6]))), + #("A14", Stop("A14", Manhattan, set([C, B]))), + #("211", Stop("211", Bronx, set([N2, N5]))), + #("N07", Stop("N07", Brooklyn, set([N]))), + #("225", Stop("225", Manhattan, set([N2, N3]))), + #("B14", Stop("B14", Brooklyn, set([D]))), + #("R45", Stop("R45", Brooklyn, set([R]))), + #("G28", Stop("G28", Brooklyn, set([G]))), + #("A33", Stop("A33", Manhattan, set([C, E]))), + #("411", Stop("411", Bronx, set([N4]))), + #("A09", Stop("A09", Manhattan, set([C, A]))), + #("G05", Stop("G05", Queens, set([J, E, Z]))), + #("109", Stop("109", Manhattan, set([N1]))), + #("R40", Stop("R40", Brooklyn, set([R]))), + #("A59", Stop("A59", Queens, set([A]))), + #("A50", Stop("A50", Brooklyn, set([C]))), + #("G14", Stop("G14", Queens, set([M, F, R, E]))), + #("D35", Stop("D35", Brooklyn, set([Q, B]))), + #("626", Stop("626", Manhattan, set([N4, N5, N6]))), + #("R03", Stop("R03", Queens, set([W, N]))), + #("216", Stop("216", Bronx, set([N2, N5]))), + #("D01", Stop("D01", Bronx, set([D]))), + #("706", Stop("706", Queens, set([N7]))), + #("243", Stop("243", Brooklyn, set([N2, N5]))), + #("F23", Stop("F23", Brooklyn, set([F, G]))), + #("F26", Stop("F26", Brooklyn, set([F, G]))), + #("F38", Stop("F38", Brooklyn, set([F]))), + #("205", Stop("205", Bronx, set([N2, N5]))), + #("L16", Stop("L16", Brooklyn, set([L]))), + #("L28", Stop("L28", Brooklyn, set([L]))), + #("721", Stop("721", Queens, set([N7]))), + #("621", Stop("621", Manhattan, set([N4, N5, N6]))), + #("S24", Stop("S24", StatenIsland, set([Si]))), + #("137", Stop("137", Manhattan, set([N1, N2, N3]))), + #("A65", Stop("A65", Queens, set([A]))), + #("B19", Stop("B19", Brooklyn, set([D]))), + #("M19", Stop("M19", Manhattan, set([J, Z]))), + #("R33", Stop("R33", Brooklyn, set([R]))), + #("239", Stop("239", Brooklyn, set([N2, N3, N4, N5]))), + #("636", Stop("636", Manhattan, set([N6]))), + #("D28", Stop("D28", Brooklyn, set([Q, B]))), + #("R28", Stop("R28", Brooklyn, set([R]))), + #("J28", Stop("J28", Brooklyn, set([J, Z]))), + #("712", Stop("712", Queens, set([N7]))), + #("D41", Stop("D41", Brooklyn, set([Q]))), + #("J21", Stop("J21", Brooklyn, set([J, Z]))), + #("L22", Stop("L22", Brooklyn, set([L]))), + #("104", Stop("104", Bronx, set([N1]))), + #("G10", Stop("G10", Queens, set([M, R]))), + #("A28", Stop("A28", Manhattan, set([C, A, E]))), + #("H12", Stop("H12", Queens, set([A, Sr]))), + #("126", Stop("126", Manhattan, set([N1]))), + #("120", Stop("120", Manhattan, set([N1, N2, N3]))), + #("A45", Stop("A45", Brooklyn, set([C]))), + #("630", Stop("630", Manhattan, set([N6]))), + #("N02", Stop("N02", Brooklyn, set([N]))), + #("S13", Stop("S13", StatenIsland, set([Si]))), + #("235", Stop("235", Brooklyn, set([N2, N3, N4, N5]))), + #("247", Stop("247", Brooklyn, set([N2, N5]))), + #("401", Stop("401", Bronx, set([N4]))), + #("D17", Stop("D17", Manhattan, set([M, F, B, D]))), + #("505", Stop("505", Bronx, set([N5]))), + #("L01", Stop("L01", Manhattan, set([L]))), + #("718", Stop("718", Queens, set([N7]))), + #("612", Stop("612", Bronx, set([N6]))), + #("M12", Stop("M12", Brooklyn, set([M, J]))), + #("S28", Stop("S28", StatenIsland, set([Si]))), + #("228", Stop("228", Manhattan, set([N2, N3]))), + #("220", Stop("220", Bronx, set([N2, N5]))), + #("D07", Stop("D07", Bronx, set([B, D]))), + #("L08", Stop("L08", Brooklyn, set([L]))), + #("B06", Stop("B06", Manhattan, set([M]))), + #("J15", Stop("J15", Queens, set([J, Z]))), + #("S18", Stop("S18", StatenIsland, set([Si]))), + #("F14", Stop("F14", Manhattan, set([F]))), + #("253", Stop("253", Brooklyn, set([N3]))), ]) } diff --git a/server/dev/gen_schedule.gleam b/server/dev/gen_schedule.gleam index d1ea057..cb987af 100644 --- a/server/dev/gen_schedule.gleam +++ b/server/dev/gen_schedule.gleam @@ -13,8 +13,11 @@ import gleam/option.{None, Some} " const trips_prefix = "import subway_gleam/gtfs/st.{ - type ShapeId, A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, - N7, N7X, Q, R, S, Sf, Si, Sr, TripId, Trips, W, Z, parse_shape_id, + type ShapeId, TripId, Trips, parse_shape_id, +} +import subway_gleam/gtfs/st/route.{ + A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, N7, N7X, Q, + R, S, Sf, Si, Sr, W, Z, } import gleam/dict @@ -25,9 +28,10 @@ fn shape_id(shape_id: String) -> ShapeId { } " -const services_prefix = "import subway_gleam/gtfs/st.{ +const services_prefix = "import subway_gleam/gtfs/st.{Service, StopId} +import subway_gleam/gtfs/st/route.{ A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, N7, N7X, Q, - R, S, Service, Sf, Si, Sr, StopId, W, Z, + R, S, Sf, Si, Sr, W, Z, } import gleam/dict @@ -38,9 +42,10 @@ fn set(dict: dict.Dict(a, b)) -> set.Set(a) { } " -const stop_routes_prefix = "import subway_gleam/gtfs/st.{ +const stop_routes_prefix = "import subway_gleam/gtfs/st.{StopId} +import subway_gleam/gtfs/st/route.{ A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, N7, N7X, Q, - R, S, Sf, Si, Sr, StopId, W, Z, + R, S, Sf, Si, Sr, W, Z, } import gleam/dict @@ -67,9 +72,10 @@ fn duration(secs: Int, nanos: Int) -> Duration { } " -const routes_prefix = "import subway_gleam/gtfs/st.{ +const routes_prefix = "import subway_gleam/gtfs/st.{RouteData} +import subway_gleam/gtfs/st/route.{ A, B, C, D, E, F, FX, G, J, L, M, N, N1, N2, N3, N4, N5, N6, N6X, N7, N7X, Q, - R, RouteData, S, Sf, Si, Sr, W, Z, + R, S, Sf, Si, Sr, W, Z, } import gleam/dict diff --git a/server/src/subway_gleam/server/route/line.gleam b/server/src/subway_gleam/server/route/line.gleam index 866673b..214366f 100644 --- a/server/src/subway_gleam/server/route/line.gleam +++ b/server/src/subway_gleam/server/route/line.gleam @@ -10,6 +10,7 @@ import lustre/element/html import wisp import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route.{type Route} import subway_gleam/server/lustre_middleware.{Document, try_lustre_res} import subway_gleam/server/state @@ -17,7 +18,7 @@ pub fn line(req: wisp.Request, state: state.State, route_id: String) { use _req <- try_lustre_res(req) use route <- result.try( - st.route_id_long_to_route(route_id) + route.from_long_id(route_id) |> result.replace_error(error_unknown_route(route_id)), ) @@ -74,13 +75,13 @@ fn error_unknown_route( } fn error_no_service( - route: st.Route, + route: Route, ) -> #(lustre_middleware.LustreRes(msg), wisp.Response) { #( Document(head: [html.title([], "Error: No route data")], body: [ html.p([], [ html.text( - "Error: Could not find data for route " <> st.route_to_long_id(route), + "Error: Could not find data for route " <> route.to_long_id(route), ), ]), ]), diff --git a/server/src/subway_gleam/server/route/stop.gleam b/server/src/subway_gleam/server/route/stop.gleam index 6bb618c..3187a7d 100644 --- a/server/src/subway_gleam/server/route/stop.gleam +++ b/server/src/subway_gleam/server/route/stop.gleam @@ -15,6 +15,7 @@ import wisp import subway_gleam/gtfs/rt import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route.{type Route} import subway_gleam/server/hydration_scripts.{hydration_scripts} import subway_gleam/server/log import subway_gleam/server/lustre_middleware.{Document, try_lustre_res} @@ -182,7 +183,7 @@ pub fn model( // it adds slightly noticable lag to each request pub fn filter_alerts( gtfs: rt.Data, - routes: set.Set(st.Route), + routes: set.Set(Route), stop_id: st.StopId, ) -> List(rt.Alert) { let current_time = util.current_time() @@ -211,7 +212,7 @@ pub fn filter_alerts( let matches_route_id = target.route_id |> option.to_result(Nil) - |> result.try(fn(id) { st.parse_route(id) |> result.replace_error(Nil) }) + |> result.try(fn(id) { route.parse(id) |> result.replace_error(Nil) }) |> result.map(set.contains(_, in: routes)) |> result.unwrap(or: False) @@ -289,7 +290,7 @@ fn arrival_li( let train_url = "/train/" <> rt.trip_id_to_string(trip.id) <> "/?" <> query // TODO: use default route bullet instead of panicking - let assert Ok(route) = st.parse_route(trip.route) + let assert Ok(route) = route.parse(trip.route) let route = schedule |> st.route_data(for: route) |> route_bullet.from_route_data diff --git a/server/src/subway_gleam/server/route/stop/alerts.gleam b/server/src/subway_gleam/server/route/stop/alerts.gleam index bb5f333..6d06751 100644 --- a/server/src/subway_gleam/server/route/stop/alerts.gleam +++ b/server/src/subway_gleam/server/route/stop/alerts.gleam @@ -9,6 +9,7 @@ import wisp import subway_gleam/gtfs/rt import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route import subway_gleam/server/lustre_middleware.{Document, try_lustre_res} import subway_gleam/server/route/stop import subway_gleam/server/state @@ -40,7 +41,7 @@ pub fn alerts( |> dict.get(stop_id) |> result.unwrap(or: set.new()) let route = - route_id |> option.to_result(Nil) |> result.try(st.route_id_long_to_route) + route_id |> option.to_result(Nil) |> result.try(route.from_long_id) let gtfs_store.Data(current: gtfs, last_updated:) = state.fetch_gtfs(state) @@ -83,7 +84,10 @@ pub fn alerts( Ok(#(Document(head:, body:), wisp.response(200))) } -fn rt_alert_to_model_alert(alert: rt.Alert, state: state.State) -> alerts.Alert { +fn rt_alert_to_model_alert( + alert: rt.Alert, + state: state.State, +) -> alerts.Alert { let routes = rt.routes_in_alert(alert) |> set.map(st.route_data(in: state.schedule, for: _)) diff --git a/server/src/subway_gleam/server/route/train.gleam b/server/src/subway_gleam/server/route/train.gleam index 936736b..08b74a7 100644 --- a/server/src/subway_gleam/server/route/train.gleam +++ b/server/src/subway_gleam/server/route/train.gleam @@ -8,11 +8,11 @@ import gleam/time/timestamp import gleam/uri import lustre/attribute import lustre/element/html -import subway_gleam/shared/util/time import wisp import subway_gleam/gtfs/rt import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route import subway_gleam/server/hydration_scripts.{hydration_scripts} import subway_gleam/server/lustre_middleware.{Document, try_lustre_res} import subway_gleam/server/state @@ -21,6 +21,7 @@ import subway_gleam/server/time_zone import subway_gleam/shared/component/route_bullet import subway_gleam/shared/route/train import subway_gleam/shared/util/live_status +import subway_gleam/shared/util/time pub fn train( req: wisp.Request, @@ -75,7 +76,7 @@ pub fn model( use #(trip, stops) <- result.try(trip) // TODO: use default route bullet instead of panicking - let assert Ok(route) = trip.route |> st.parse_route + let assert Ok(route) = trip.route |> route.parse let route = state.schedule |> st.route_data(route) |> route_bullet.from_route_data diff --git a/shared/src/subway_gleam/shared/route/stop/alerts.gleam b/shared/src/subway_gleam/shared/route/stop/alerts.gleam index a81b85a..eb92785 100644 --- a/shared/src/subway_gleam/shared/route/stop/alerts.gleam +++ b/shared/src/subway_gleam/shared/route/stop/alerts.gleam @@ -7,6 +7,7 @@ import lustre/element/html import subway_gleam/gtfs/rt/rich_text.{type RichText} import subway_gleam/gtfs/st +import subway_gleam/gtfs/st/route import subway_gleam/shared/component/last_updated import subway_gleam/shared/component/navbar.{navbar} import subway_gleam/shared/component/rich_text as rich_text_component @@ -42,7 +43,7 @@ pub fn view(model: Model) -> Element(msg) { let bullets = all_routes |> set.map(fn(route) { - let route_id = st.route_to_long_id(route.id) + let route_id = route.to_long_id(route.id) let bullet = route_bullet.from_route_data(route) html.a( [