Contains the task for importing Route colors from Google Transit. This task is run once per year(?).
Esempio n. 1
0
        public BusSystemData 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);

            return(new BusSystemData(
                       staticData,
                       schedule,
                       platformTagsLookup));
        }