Package models.transit

Examples of models.transit.Route


            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();
             
View Full Code Here


    public static void getRoute(Long id, Long agencyId) {
        try {
            if(id != null)
            {
                Route route = Route.findById(id);
                if(route != null)
                    renderJSON(Api.toJson(route, false));
                else
                    notFound();
            }
View Full Code Here

        }

    }

    public static void createRoute() {
        Route route;

        try {
            route = mapper.readValue(params.get("body"), Route.class);

            if(Agency.findById(route.agency.id) == null)
                badRequest();

            route.save();

            // check if gtfsRouteId is specified, if not create from DB id
            if(route.gtfsRouteId == null) {
                route.gtfsRouteId = "ROUTE_" + route.id.toString();
                route.save();
            }

            renderJSON(Api.toJson(route, false));
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        }
    }


    public static void updateRoute() {
        Route route;

        try {
            route = mapper.readValue(params.get("body"), Route.class);

            if(route.id == null || Route.findById(route.id) == null)
                badRequest();

            // check if gtfsRouteId is specified, if not create from DB id
            if(route.gtfsRouteId == null)
                route.gtfsRouteId = "ROUTE_" + route.id.toString();

            Route updatedRoute = Route.em().merge(route);
            updatedRoute.save();

            renderJSON(Api.toJson(updatedRoute, false));
        } catch (Exception e) {
            e.printStackTrace();
            badRequest();
View Full Code Here

    public static void deleteRoute(Long id) {
        if(id == null)
            badRequest();

        Route route = Route.findById(id);

        if(route == null)
            badRequest();

        route.delete();

        ok();
    }
View Full Code Here

                else
                    notFound();
            }
            else if(routeId != null) {
             
              Route r = Route.findById(routeId);
             
              if(r == null)
                badRequest();
             
              renderJSON(Api.toJson(TripPattern.find("route = ?", r).fetch(), false));
View Full Code Here

            default:
              gtfsTypeId = null;
              break;
          }
       
        Route r = Route.findById(((BigInteger)o[0]).longValue());
        r.routeType = Route.mapGtfsRouteType(gtfsTypeId);
       
        r.save();
     
     
      String step = "Assign Route Types";
      renderTemplate("Bootstrap/dataProcessingComplete.html", step);
    }
View Full Code Here

TOP

Related Classes of models.transit.Route

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.