Search in sources :

Example 1 with PathwayNode

use of org.opentripplanner.model.PathwayNode in project OpenTripPlanner by opentripplanner.

the class AddTransitModelEntitiesToGraph method addPathwayNodesToGraph.

private void addPathwayNodesToGraph(Graph graph) {
    for (PathwayNode node : transitService.getAllPathwayNodes()) {
        TransitPathwayNodeVertex nodeVertex = new TransitPathwayNodeVertex(graph, node);
        stationElementNodes.put(node, nodeVertex);
    }
}
Also used : TransitPathwayNodeVertex(org.opentripplanner.routing.vertextype.TransitPathwayNodeVertex) PathwayNode(org.opentripplanner.model.PathwayNode)

Example 2 with PathwayNode

use of org.opentripplanner.model.PathwayNode in project OpenTripPlanner by opentripplanner.

the class GTFSToOtpTransitServiceMapper method mapGtfsStopsToOtpTypes.

private void mapGtfsStopsToOtpTypes(GtfsRelationalDao data, OtpTransitServiceBuilder builder) {
    StopToParentStationLinker stopToParentStationLinker = new StopToParentStationLinker(issueStore);
    for (org.onebusaway.gtfs.model.Stop it : data.getAllStops()) {
        if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_STOP) {
            Stop stop = stopMapper.map(it);
            builder.getStops().add(stop);
            stopToParentStationLinker.addStationElement(stop, it.getParentStation());
        } else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_STATION) {
            Station station = stationMapper.map(it);
            builder.getStations().add(station);
            stopToParentStationLinker.addStation(station);
        } else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_ENTRANCE_EXIT) {
            Entrance entrance = entranceMapper.map(it);
            builder.getEntrances().add(entrance);
            stopToParentStationLinker.addStationElement(entrance, it.getParentStation());
        } else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_NODE) {
            PathwayNode pathwayNode = pathwayNodeMapper.map(it);
            builder.getPathwayNodes().add(pathwayNode);
            stopToParentStationLinker.addStationElement(pathwayNode, it.getParentStation());
        } else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_BOARDING_AREA) {
            BoardingArea boardingArea = boardingAreaMapper.map(it);
            builder.getBoardingAreas().add(boardingArea);
            stopToParentStationLinker.addBoardingArea(boardingArea, it.getParentStation());
        }
    }
    stopToParentStationLinker.link();
}
Also used : Station(org.opentripplanner.model.Station) Entrance(org.opentripplanner.model.Entrance) Stop(org.opentripplanner.model.Stop) PathwayNode(org.opentripplanner.model.PathwayNode) BoardingArea(org.opentripplanner.model.BoardingArea)

Aggregations

PathwayNode (org.opentripplanner.model.PathwayNode)2 BoardingArea (org.opentripplanner.model.BoardingArea)1 Entrance (org.opentripplanner.model.Entrance)1 Station (org.opentripplanner.model.Station)1 Stop (org.opentripplanner.model.Stop)1 TransitPathwayNodeVertex (org.opentripplanner.routing.vertextype.TransitPathwayNodeVertex)1