コード例 #1
0
        public (BusSystemData data, List <string> errors) LoadTransitData()
        {
            var connexionzPlatforms = ConnexionzClient.LoadPlatforms();
            var connexionzRoutes    = ConnexionzClient.LoadRoutes();
            var googleData          = GoogleTransitClient.LoadData();

            var routes = CreateRoutes(googleData.Routes, connexionzRoutes);
            var stops  = CreateStops(connexionzPlatforms, connexionzRoutes);

            var staticData = new BusStaticData(
                routes: routes.ToDictionary(r => r.RouteNo),
                stops: stops.ToDictionary(s => s.Id)
                );

            var platformTagsLookup = connexionzPlatforms.ToDictionary(p => p.PlatformNo, p => p.PlatformTag);
            var schedule           = CreateSchedule(googleData.Schedules, connexionzRoutes, connexionzPlatforms);

            var transitData = new BusSystemData(
                staticData,
                schedule,
                platformTagsLookup);

            var errors = ValidateTransitData(transitData);

            return(transitData, errors);
        }
コード例 #2
0
 public async Task <ConnexionzPlatformET?> GetEta(int platformTag) => await ConnexionzClient.GetPlatformEta(platformTag);