Package org.onebusaway.gtfs.impl

Examples of org.onebusaway.gtfs.impl.GtfsDaoImpl


        e.printStackTrace();
      }
    }
   
    GtfsReader reader = new GtfsReader();
      GtfsDaoImpl store = new GtfsDaoImpl();
     
      Long agencyCount = new Long(0);
     
      try {
       
        File gtfsFile = new File(Play.configuration.getProperty("application.publicGtfsDataDirectory"), snapshotMerge.snapshot.getFilename());
       
        reader.setInputLocation(gtfsFile);
          reader.setEntityStore(store);
          reader.run();
           
          Logger.info("GtfsImporter: listing agencies...");
         
        for (org.onebusaway.gtfs.model.Agency gtfsAgency : reader.getAgencies()) {
          
          GtfsAgency agency = new GtfsAgency(gtfsAgency);
          agency.snapshot = snapshotMerge.snapshot;
          agency.save();
     
        }
       
        snapshotMerge.snapshot.agencyCount = store.getAllAgencies().size();
        snapshotMerge.snapshot.routeCount = store.getAllRoutes().size();
        snapshotMerge.snapshot.stopCount = store.getAllStops().size();
        snapshotMerge.snapshot.tripCount = store.getAllTrips().size();
       
        snapshotMerge.snapshot.save();
       
      }
      catch (Exception e) {
View Full Code Here


        e.printStackTrace();
      }
    }
   
    GtfsReader reader = new GtfsReader();
      GtfsDaoImpl store = new GtfsDaoImpl();
     
      Long agencyCount = new Long(0);
      Long routeCount = new Long(0);
      Long stopCount = new Long(0);
      Long stopTimeCount = new Long(0);
      Long tripCount = new Long(0);
      Long shapePointCount = new Long(0);
      Long serviceCalendarCount = new Long(0);
      Long serviceCalendarDateCount = new Long(0);
      Long shapeCount = new Long(0);
     
      try {
       
        File gtfsFile = new File(Play.configuration.getProperty("application.publicDataDirectory"), snapshotMerge.snapshot.getFilename());
       
        reader.setInputLocation(gtfsFile);
          reader.setEntityStore(store);
          reader.run();
           
          Logger.info("GtfsImporter: importing agencies...");
       
          GtfsSnapshotMergeTask agencyTask = new GtfsSnapshotMergeTask(snapshotMerge);
          agencyTask.startTask();
       
         
          List<Agency> agencies = Agency.findAll();
         
          for (Agency agency : agencies)
          {
            agencyIdMap.put(agency.gtfsAgencyId, new BigInteger(agency.id.toString()));
          }
         
          BigInteger primaryAgencyId = null;
         
         
         
        for (org.onebusaway.gtfs.model.Agency gtfsAgency : reader.getAgencies()) {
         
          if(!agencyIdMap.containsKey(gtfsAgency.getId()))
          {
            Agency agency = new Agency(gtfsAgency);
            agency.save();
           
            agencyIdMap.put(agency.gtfsAgencyId, BigInteger.valueOf(agency.id));
           
            primaryAgencyId = BigInteger.valueOf(agency.id);
           
            agencyCount++;     
          }
          else
            primaryAgencyId = agencyIdMap.get(gtfsAgency.getId());
         
        }
       
        Agency primaryAgency = Agency.findById(primaryAgencyId.longValue());
       
        agencyTask.completeTask("Imported " + agencyCount + " agencies.", GtfsSnapshotMergeTaskStatus.SUCCESS);
       
        Logger.info("Agencies loaded: " + agencyCount.toString());
        Logger.info("GtfsImporter: importing routes...");
       
        GtfsSnapshotMergeTask routeTask = new GtfsSnapshotMergeTask(snapshotMerge);
        routeTask.startTask();
       
          for (org.onebusaway.gtfs.model.Route gtfsRoute : store.getAllRoutes()) {
         
            BigInteger agencyId = agencyIdMap.get(gtfsRoute.getAgency().getId());
            BigInteger routeId = Route.nativeInsert(snapshotMerge.em(), gtfsRoute, agencyId);
             
              routeIdMap.put(gtfsRoute.getId().toString(), routeId );
                        
            routeCount++;
          }
         
          if(agencyCount > 1)
          primaryAgencyId = null;
         
          routeTask.completeTask("Imported " + routeCount + " routes.", GtfsSnapshotMergeTaskStatus.SUCCESS);
         
          Logger.info("Routes loaded:" + routeCount.toString());
          Logger.info("GtfsImporter: importing stops...");
       
        GtfsSnapshotMergeTask stopTask = new GtfsSnapshotMergeTask(snapshotMerge);
        stopTask.startTask();
       
          for (org.onebusaway.gtfs.model.Stop gtfsStop : store.getAllStops()) {      
            
            BigInteger stopId = Stop.nativeInsert(snapshotMerge.em(), gtfsStop, primaryAgencyId);
              stopIdMap.put(gtfsStop.getId().toString(), stopId );
                        
            stopCount++;
          }
         
          stopTask.completeTask("Imported " + stopCount + " stops.", GtfsSnapshotMergeTaskStatus.SUCCESS);
         
          Logger.info("Stops loaded: " + stopCount);
          Logger.info("GtfsImporter: importing Shapes...");
         
          Logger.info("Calculating agency centroid for stops...");
         
        Point centroid = Stop.findCentroid(primaryAgencyId);
        Logger.info("Center: " + centroid.getCoordinate().y + ", " + centroid.getCoordinate().x);
         
        primaryAgency.defaultLat = centroid.getCoordinate().y;
        primaryAgency.defaultLon = centroid.getCoordinate().x;
       
        primaryAgency.save();
       
          GtfsSnapshotMergeTask tripShapeTask = new GtfsSnapshotMergeTask(snapshotMerge);
          tripShapeTask.startTask();
         
          // import points
         
          for (org.onebusaway.gtfs.model.ShapePoint shapePoint : store.getAllShapePoints()) {
         
            List<org.onebusaway.gtfs.model.ShapePoint> shapePoints  = shapePointIdMap.get(shapePoint.getShapeId().toString());
         
            if(shapePoints  != null)
            {
              shapePoints.add(shapePoint);
            }
            else
            {
              shapePoints = new ArrayList<org.onebusaway.gtfs.model.ShapePoint>();
              shapePoints.add(shapePoint);
           
              shapePointIdMap.put(shapePoint.getShapeId().toString(), shapePoints);
            }
           
            shapePointCount++;

          }
         
         
          // sort/load points
         
         
         
          for(String gtfsShapeId : shapePointIdMap.keySet())
          {
           
            List<org.onebusaway.gtfs.model.ShapePoint> shapePoints  = shapePointIdMap.get(gtfsShapeId);
           
            Collections.sort(shapePoints);
           
            Double describedDistance = new Double(0);
            List<String> points = new ArrayList<String>();
           
            for(org.onebusaway.gtfs.model.ShapePoint shapePoint : shapePoints)
            {
              describedDistance += shapePoint.getDistTraveled();
             
              points.add(new Double(shapePoint.getLon()).toString() + " " + new Double(shapePoint.getLat()).toString());
             
             
             
            }
           
            String linestring = "LINESTRING(" + StringUtils.join(points, ", ") + ")";
             
            BigInteger tripShapeId = TripShape.nativeInsert(snapshotMerge.em(), gtfsShapeId, linestring, describedDistance);
           
              tripShapeIdMap.put(gtfsShapeId, tripShapeId);
             
              shapeCount++;
         
          }
         
          Logger.info("Shape points loaded: " + shapePointCount.toString());
          Logger.info("Shapes loaded: " + shapeCount.toString());
         
          tripShapeTask.completeTask("Imported " + shapePointCount + " points in " + shapeCount + " shapes.", GtfsSnapshotMergeTaskStatus.SUCCESS);

         
          GtfsSnapshotMergeTask serviceCalendarsTask = new GtfsSnapshotMergeTask(snapshotMerge);
          serviceCalendarsTask.startTask();
         
          Logger.info("GtfsImporter: importing Service Calendars...");
       
          for (org.onebusaway.gtfs.model.ServiceCalendar gtfsService : store.getAllCalendars()) {
           
            BigInteger serviceId = ServiceCalendar.nativeInsert(snapshotMerge.em(), gtfsService, primaryAgencyId);
                     
            serviceIdMap.put(gtfsService.getServiceId().toString(), serviceId);
           
            serviceCalendarCount++;
           
          }
     
         
          Logger.info("Service calendars loaded: " + serviceCalendarCount);
         
          serviceCalendarsTask.completeTask("Imported " + serviceCalendarCount.toString() + " Service calendars.", GtfsSnapshotMergeTaskStatus.SUCCESS);
         
         
          Logger.info("GtfsImporter: importing Service Calendar dates...");
         
          GtfsSnapshotMergeTask serviceCalendarDatesTask = new GtfsSnapshotMergeTask(snapshotMerge);
          serviceCalendarDatesTask.startTask();
       
          for (org.onebusaway.gtfs.model.ServiceCalendarDate gtfsServiceDate : store.getAllCalendarDates()) {
           
            BigInteger serviceDateId = ServiceCalendarDate.nativeInsert(snapshotMerge.em(), gtfsServiceDate);
           
            serviceDateIdMap.put(gtfsServiceDate.getServiceId().toString(), serviceDateId);
           
            serviceCalendarDateCount++;
           
          }
     
          serviceCalendarDatesTask.completeTask("Imported " + serviceCalendarDateCount.toString() + " Service calendar dates.", GtfsSnapshotMergeTaskStatus.SUCCESS);
         
          Logger.info(" loaded: " + serviceCalendarDateCount);
         
          Logger.info("GtfsImporter: importing trips...");
         
          GtfsSnapshotMergeTask tripsTask = new GtfsSnapshotMergeTask(snapshotMerge);
          tripsTask.startTask();
       
          for (org.onebusaway.gtfs.model.Trip gtfsTrip : store.getAllTrips()) {
           
            BigInteger routeId = routeIdMap.get(gtfsTrip.getRoute().getId().toString());
           
            BigInteger shapeId = null;
           
            if(gtfsTrip.getShapeId() != null)
              shapeId = tripShapeIdMap.get(gtfsTrip.getShapeId().toString());
     
            BigInteger serviceId = serviceIdMap.containsKey(gtfsTrip.getServiceId().toString()) ? serviceIdMap.get(gtfsTrip.getServiceId().toString()) : null;
            BigInteger serviceDateId = serviceDateIdMap.containsKey(gtfsTrip.getServiceId().toString()) ? serviceDateIdMap.get(gtfsTrip.getServiceId().toString()) : null;
           
            BigInteger tripId = Trip.nativeInsert(snapshotMerge.em(), gtfsTrip, routeId, shapeId, serviceId, serviceDateId);
                     
            tripIdMap.put(gtfsTrip.getId().toString(), tripId);
           
            tripCount++;
         
          }
     
         
          Logger.info("Trips loaded: " + tripCount);
         
          tripsTask.completeTask("Imported " + tripCount.toString() + " trips.", GtfsSnapshotMergeTaskStatus.SUCCESS);
         
         
          Logger.info("GtfsImporter: importing stopTimes...");
       
          GtfsSnapshotMergeTask stopTimesTask = new GtfsSnapshotMergeTask(snapshotMerge);
          stopTimesTask.startTask();
    
          for (org.onebusaway.gtfs.model.StopTime gtfsStopTime : store.getAllStopTimes()) {
           
            BigInteger stopId = stopIdMap.get(gtfsStopTime.getStop().getId().toString());
            BigInteger tripId = tripIdMap.get(gtfsStopTime.getTrip().getId().toString());
           
            BigInteger stopTimeId = StopTime.nativeInsert(snapshotMerge.em(), gtfsStopTime, tripId, stopId);
View Full Code Here

    }
   
    try
    {
      GtfsWriter writer = new GtfsWriter();
      GtfsDaoImpl store = new GtfsDaoImpl();
     
      File gtfsDirectory = new File(Play.configuration.getProperty("application.publicDataDirectory"), snapshotExport.getDirectory());
      File gtfsZip = new File(Play.configuration.getProperty("application.publicDataDirectory"), snapshotExport.getDirectory() + ".zip");
     
      writer.setOutputLocation(gtfsDirectory);
   
      HashMap<Long, org.onebusaway.gtfs.model.Stop> stopList = new HashMap<Long, org.onebusaway.gtfs.model.Stop>();
      HashMap<Long, org.onebusaway.gtfs.model.Route> routeList = new HashMap<Long, org.onebusaway.gtfs.model.Route>();
      HashMap<Long, org.onebusaway.gtfs.model.AgencyAndId> shapeList = new HashMap<Long, org.onebusaway.gtfs.model.AgencyAndId>();
   
     
      for(Agency agency : snapshotExport.agencies)
      {
        org.onebusaway.gtfs.model.Agency a = new org.onebusaway.gtfs.model.Agency();
       
        String gtfsAgencyId = agency.id.toString();
       
       
        if(agency.gtfsAgencyId != null && !agency.gtfsAgencyId.isEmpty())
          gtfsAgencyId = agency.gtfsAgencyId;
       
        a.setId(gtfsAgencyId);
        a.setName(agency.name);
        a.setUrl(agency.url);
        a.setTimezone(agency.timezone);
       
        store.saveEntity(a);
           
        List<ServiceCalendar> calendars = ServiceCalendar.find("agency = ?", agency).fetch();
       
        for(ServiceCalendar calendar : calendars)
        {
          org.onebusaway.gtfs.model.ServiceCalendar c = new org.onebusaway.gtfs.model.ServiceCalendar();
         
          AgencyAndId calendarId = new AgencyAndId();
         
          calendarId.setAgencyId(gtfsAgencyId);
          calendarId.setId(calendar.getId().toString());
       
          c.setServiceId(calendarId);
         
          c.setStartDate(new ServiceDate(snapshotExport.calendarFrom)); // calendar.startDate

          c.setEndDate(new ServiceDate(snapshotExport.calendarTo)); // calendar.endDate
         
          c.setMonday(calendar.monday? 1 : 0);
          c.setTuesday(calendar.tuesday? 1 : 0);
          c.setWednesday(calendar.wednesday? 1 : 0);
          c.setThursday(calendar.thursday? 1 : 0);
          c.setFriday(calendar.friday? 1 : 0);
          c.setSaturday(calendar.saturday? 1 : 0);
          c.setSunday(calendar.sunday? 1 : 0);
       
          store.saveEntity(c);
         
          List<ServiceCalendarDate> calendarDates = ServiceCalendarDate.find("calendar = ?", calendar).fetch();
         
          for(ServiceCalendarDate calendarDate : calendarDates)
          {
            org.onebusaway.gtfs.model.ServiceCalendarDate cDate = new org.onebusaway.gtfs.model.ServiceCalendarDate();
           
            cDate.setServiceId(calendarId);
           
            cDate.setDate(new ServiceDate(calendarDate.date));
           
            cDate.setExceptionType(calendarDate.exceptionType == ServiceCalendarDateType.ADDED? 1 : 0);
           
            store.saveEntity(cDate);
          }
         
          List<Trip> trips = Trip.find("serviceCalendar = ?", calendar).fetch();
         
          for(Trip trip : trips)
          { 
            List<TripPatternStop> patternStopTimes = TripPatternStop.find("pattern = ? order by stopSequence", trip.pattern).fetch();
           
            if(trip.useFrequency == null || patternStopTimes == null || (trip.useFrequency && patternStopTimes.size() == 0) || !trip.pattern.route.agency.id.equals(agency.id) || (trip.useFrequency && trip.headway.equals(0)) || (trip.useFrequency && trip.startTime.equals(trip.endTime)))
              continue;

            if(!routeList.containsKey(trip.pattern.route.id))
            {
              Route route = trip.pattern.route;
             
              org.onebusaway.gtfs.model.Route r = new org.onebusaway.gtfs.model.Route();
             
              AgencyAndId routeId = new AgencyAndId();
             
              routeId.setAgencyId(gtfsAgencyId);
             
              if(route.gtfsRouteId != null && !route.gtfsRouteId.isEmpty())
                routeId.setId(route.gtfsRouteId);
              else
                routeId.setId(route.id.toString());
              Logger.info(gtfsAgencyId + " " + routeId);
              r.setId(routeId);
              r.setAgency(a);
             
              if(route.routeColor != null && !route.routeColor.isEmpty())
                r.setColor(route.routeColor.replace("#", ""));
             
              if(route.routeDesc != null)
                r.setDesc(route.routeDesc.replace("\n", "").replace("\r", ""));
             
              r.setLongName(route.routeLongName);
              r.setShortName(route.routeShortName);
              r.setType(Route.mapGtfsRouteType(route.routeType));
              r.setUrl(route.routeUrl);
             
              store.saveEntity(r);
             
              routeList.put(route.id, r);
            }
           
            if(trip.pattern.shape != null && !shapeList.containsKey(trip.pattern.shape.id))
            {
              TripShape shape = trip.pattern.shape;
             
              AgencyAndId shapeId = new AgencyAndId();
             
              shapeId.setAgencyId(gtfsAgencyId);
              shapeId.setId(shape.id.toString());
             
              int sequence = 0;
             
              for(Coordinate coordinate : shape.shape.getCoordinates())
              {
                org.onebusaway.gtfs.model.ShapePoint coord = new org.onebusaway.gtfs.model.ShapePoint();
               
                coord.setShapeId(shapeId);
               
                coord.setLon(coordinate.x);
                coord.setLat(coordinate.y);
                coord.setSequence(sequence);
               
                sequence++;
               
                store.saveEntity(coord);
              }
             
              shapeList.put(shape.id, shapeId);
            }
           
           
           
           
            org.onebusaway.gtfs.model.Trip t = new org.onebusaway.gtfs.model.Trip();
           
            AgencyAndId tripId = new AgencyAndId();
           
            tripId.setAgencyId(gtfsAgencyId);
            tripId.setId(trip.getId().toString());
           
            t.setId(tripId);
            t.setRoute(routeList.get(trip.pattern.route.id));
            t.setRouteShortName(trip.pattern.route.routeShortName);
            t.setTripHeadsign(trip.pattern.name);
            t.setServiceId(calendarId);
           
            if(trip.wheelchairBoarding != null){
              if(trip.wheelchairBoarding.equals(AttributeAvailabilityType.AVAILABLE))
                t.setWheelchairAccessible(1);
              else if(trip.wheelchairBoarding.equals(AttributeAvailabilityType.UNAVAILABLE))
                t.setWheelchairAccessible(2);
              else
                t.setWheelchairAccessible(0);
            }
            else if(trip.pattern.route.wheelchairBoarding != null) {
              if(trip.pattern.route.wheelchairBoarding.equals(AttributeAvailabilityType.AVAILABLE))
                t.setWheelchairAccessible(1);
              else if(trip.pattern.route.wheelchairBoarding.equals(AttributeAvailabilityType.UNAVAILABLE))
                t.setWheelchairAccessible(2);
              else
                t.setWheelchairAccessible(0);
             
            }
           
            if(trip.pattern.shape != null)
              t.setShapeId(shapeList.get(trip.pattern.shape.id));
            else
              Logger.error("trip " + trip.tripHeadsign + " is missing shape");
           
            t.setBlockId(trip.blockId);
           
            store.saveEntity(t);
           
           
           
           
            if(trip.useFrequency != null && trip.useFrequency && trip.headway > 0)
            {
              org.onebusaway.gtfs.model.Frequency f = new org.onebusaway.gtfs.model.Frequency();
                     
              f.setTrip(t);
             
              f.setStartTime(trip.startTime);
              f.setEndTime(trip.endTime);
              f.setHeadwaySecs(trip.headway);
             
              store.saveEntity(f);
             
             
             
              Integer cumulativeTime = 0;
             
              for(TripPatternStop stopTime : patternStopTimes)
              {
                if(!stopList.containsKey(stopTime.stop.id))
                {
                  Stop stop = stopTime.stop;
                 
                  AgencyAndId stopId = new AgencyAndId();
                 
                  stopId.setAgencyId(gtfsAgencyId);
             
                  if(stop.gtfsStopId != null && !stop.gtfsStopId.isEmpty())
                    stopId.setId(stop.gtfsStopId);
                  else
                    stopId.setId("STOP_" + stop.id.toString());
                 
                  org.onebusaway.gtfs.model.Stop s = new org.onebusaway.gtfs.model.Stop();
                 
                  s.setId(stopId);
                 
                  s.setCode(stop.stopCode);
                 
                  if(stop.stopName == null || stop.stopName.isEmpty())
                    s.setName(stop.id.toString());
                  else
                    s.setName(stop.stopName.replace("\n", "").replace("\r", ""));
                 
                  if(stop.stopDesc != null && !stop.stopName.isEmpty())
                    s.setDesc(stop.stopDesc.replace("\n", "").replace("\r", ""));
                 
                  s.setUrl(stop.stopUrl);
                 
                  s.setLon(stop.locationPoint().getX());
                  s.setLat(stop.locationPoint().getY());
                 
                 
                  if(stop.wheelchairBoarding != null && stop.wheelchairBoarding.equals(AttributeAvailabilityType.AVAILABLE))
                    s.setWheelchairBoarding(1);
                  else if(stop.wheelchairBoarding != null && stop.wheelchairBoarding.equals(AttributeAvailabilityType.UNAVAILABLE))
                    s.setWheelchairBoarding(2);
                  else
                    s.setWheelchairBoarding(0);
                 
                  store.saveEntity(s);
                                 
                  stopList.put(stop.id, s);
                }
               
                org.onebusaway.gtfs.model.StopTime st = new org.onebusaway.gtfs.model.StopTime();
               
                if(stopTime.defaultTravelTime != null) {
                 
                  // need to flag negative travel times in the patterns!
                  if(stopTime.defaultTravelTime < 0)
                    cumulativeTime -= stopTime.defaultTravelTime;
                  else
                    cumulativeTime += stopTime.defaultTravelTime; 
                }
                 
               
                st.setArrivalTime(cumulativeTime);
               
                if(stopTime.defaultDwellTime != null) {
                 
                  // need to flag negative dwell times in the patterns!
                  if(stopTime.defaultDwellTime < 0)
                    cumulativeTime -= stopTime.defaultDwellTime;
                  else
                    cumulativeTime += stopTime.defaultDwellTime;
                }
                 
               
                st.setDepartureTime(cumulativeTime);
               
                st.setTrip(t);
                st.setStop(stopList.get(stopTime.stop.id));
                st.setStopSequence(stopTime.stopSequence);
         
                     
                store.saveEntity(st);
              }

            }
            else
            {
           
              List<StopTime> stopTimes = StopTime.find("trip = ? order by stopSequence", trip).fetch();
             
              for(StopTime stopTime : stopTimes)
              {
                if(!stopList.containsKey(stopTime.stop.id))
                {
                  Stop stop = stopTime.stop;
                 
                  AgencyAndId stopId = new AgencyAndId();
                 
                  stopId.setAgencyId(gtfsAgencyId);
                 
                  if(stop.gtfsStopId != null && !stop.gtfsStopId.isEmpty())
                    stopId.setId(stop.gtfsStopId);
                  else
                    stopId.setId(stop.id.toString());
                 
                  org.onebusaway.gtfs.model.Stop s = new org.onebusaway.gtfs.model.Stop();
                 
                  s.setId(stopId);
                 
                  s.setCode(stop.stopCode);
                  if(stop.stopName == null || stop.stopName.isEmpty())
                    s.setName(stop.id.toString());
                  else
                    s.setName(stop.stopName.replace("\n", "").replace("\r", ""));
                 
                  if(stop.stopDesc != null && !stop.stopName.isEmpty())
                    s.setDesc(stop.stopDesc.replace("\n", "").replace("\r", ""));
                 
                  s.setUrl(stop.stopUrl);
                 
                  s.setLon(stop.locationPoint().getX());
                  s.setLat(stop.locationPoint().getY());
                 
                  if(stop.wheelchairBoarding != null && stop.wheelchairBoarding.equals(AttributeAvailabilityType.AVAILABLE))
                    s.setWheelchairBoarding(1);
                  else if(stop.wheelchairBoarding != null && stop.wheelchairBoarding.equals(AttributeAvailabilityType.UNAVAILABLE))
                    s.setWheelchairBoarding(2);
                  else
                    s.setWheelchairBoarding(0);
                 
                  store.saveEntity(s);
                                 
                  stopList.put(stop.id, s);
                }
               
                org.onebusaway.gtfs.model.StopTime st = new org.onebusaway.gtfs.model.StopTime();
               
                if(stopTime.arrivalTime != null)
                  st.setArrivalTime(stopTime.arrivalTime);
                if(stopTime.departureTime != null)
                  st.setDepartureTime(stopTime.departureTime);
               
                st.setTrip(t);
                st.setStop(stopList.get(stopTime.stop.id));
                st.setStopSequence(stopTime.stopSequence);
         
                     
                store.saveEntity(st);
              }
            }
          }
        }
       
View Full Code Here

    List<String> paths = new ArrayList<String>();

    paths.add(args[0]);

    ConfigurableApplicationContext context = ContainerLibrary.createContext(paths);
    GtfsDaoImpl store = new GtfsDaoImpl();

    DefaultEntitySchemaFactory schema = GtfsEntitySchemaFactory.createEntitySchemaFactory();
    GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Stop.class,
        "stop_direction", "stopDirection");
    GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Trip.class,
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs.impl.GtfsDaoImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.