Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into otp_nl

  • Loading branch information...
commit 2dde4c1087e2606f2dc0fd6a0eab53c898457098 2 parents 6df817b + e659ca4
Joel Haasnoot authored
View
1  .gitignore
@@ -14,6 +14,7 @@ opentripplanner-api-extended/src/main/resources/data-sources.xml
opentripplanner-api-webapp/src/main/resources/Message.properties
opentripplanner-api-webapp/src/main/resources/Message_es.properties
opentripplanner-api-webapp/src/main/resources/Message_fr.properties
+opentripplanner-api-webapp/src/main/resources/Message_nl.properties
opentripplanner-api-webapp/src/main/resources/data-sources.xml
opentripplanner-api-webapp/src/main/resources/org/
opentripplanner-integration/src/main/resources/
View
5 openstreetmap/src/main/java/org/opentripplanner/openstreetmap/model/OSMMap.java
@@ -22,6 +22,11 @@
import org.opentripplanner.openstreetmap.services.OpenStreetMapContentHandler;
+/**
+ * A simplistic implementation of OSMContentHandler that simply stores all of the ways, nodes, and
+ * relations in maps keyed by ids. For memory usage reasons, this is only used in tests.
+ *
+ */
public class OSMMap implements OpenStreetMapContentHandler {
private Map<Long, OSMNode> _nodes = new HashMap<Long, OSMNode>();
View
1  opentripplanner-api-webapp/src/main/java/org/opentripplanner/api/ws/PlanGenerator.java
@@ -399,6 +399,7 @@ private Itinerary generateItinerary(GraphPath path, boolean showIntermediateStop
finalizeLeg(leg, state, null, -1, -1, coordinates);
leg = makeLeg(itinerary, state);
fixupTransitLeg(leg, state);
+ leg.startTime = new Date(state.getTimeInMillis());
leg.interlineWithPreviousLeg = true;
}
} else {
View
101 ...c/main/java/org/opentripplanner/graph_builder/impl/osm/OpenStreetMapGraphBuilderImpl.java
@@ -207,14 +207,65 @@ public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {
// Remove all simple islands
_nodes.keySet().retainAll(_nodesWithNeighbors);
- long wayIndex = 0;
-
// figure out which nodes that are actually intersections
initIntersectionNodes();
+ buildBasicGraph();
+
+ buildElevatorEdges(graph);
+
+ /* unify turn restrictions */
+ Map<Edge, TurnRestriction> turnRestrictions = new HashMap<Edge, TurnRestriction>();
+ for (TurnRestriction restriction : turnRestrictionsByTag.values()) {
+ turnRestrictions.put(restriction.from, restriction);
+ }
+ if (customNamer != null) {
+ customNamer.postprocess(graph);
+ }
+
+ //generate elevation profiles
+ generateElevationProfiles(graph);
+
+ applyBikeSafetyFactor(graph);
+ StreetUtils.makeEdgeBased(graph, endpoints, turnRestrictions);
+
+ } // END buildGraph()
+
+ private void generateElevationProfiles(Graph graph) {
+ Map<EdgeWithElevation, List<ElevationPoint>> data = extraElevationData.data;
+ for (Map.Entry<EdgeWithElevation, List<ElevationPoint>> entry : data.entrySet()) {
+ EdgeWithElevation edge = entry.getKey();
+ List<ElevationPoint> points = entry.getValue();
+ Collections.sort(points);
+
+ if (points.size() == 1) {
+ ElevationPoint firstPoint = points.get(0);
+ ElevationPoint endPoint = new ElevationPoint(edge.getDistance(), firstPoint.ele);
+ points.add(endPoint);
+ }
+ Coordinate[] coords = new Coordinate[points.size()];
+ int i = 0;
+ for (ElevationPoint p : points) {
+ double d = p.distanceAlongShape;
+ if (i == 0) {
+ d = 0;
+ } else if (i == points.size() - 1) {
+ d = edge.getDistance();
+ }
+ coords[i++] = new Coordinate(d, p.ele);
+ }
+ // set elevation profile and warn if profile was flattened because it was too steep
+ if(edge.setElevationProfile(new PackedCoordinateSequence.Double(coords), true)) {
+ _log.warn(GraphBuilderAnnotation.register(graph, Variety.ELEVATION_FLATTENED, edge));
+ }
+ }
+ }
+
+ private void buildBasicGraph() {
GeometryFactory geometryFactory = new GeometryFactory();
/* build an ordinary graph, which we will convert to an edge-based graph */
+ long wayIndex = 0;
for (OSMWay way : _ways.values()) {
@@ -367,51 +418,7 @@ public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {
osmStartNode = _nodes.get(startNode);
}
} // END loop over OSM ways
-
- buildElevatorEdges(graph);
-
- /* unify turn restrictions */
- Map<Edge, TurnRestriction> turnRestrictions = new HashMap<Edge, TurnRestriction>();
- for (TurnRestriction restriction : turnRestrictionsByTag.values()) {
- turnRestrictions.put(restriction.from, restriction);
- }
- if (customNamer != null) {
- customNamer.postprocess(graph);
- }
-
- //generate elevation profiles
- Map<EdgeWithElevation, List<ElevationPoint>> data = extraElevationData.data;
- for (Map.Entry<EdgeWithElevation, List<ElevationPoint>> entry : data.entrySet()) {
- EdgeWithElevation edge = entry.getKey();
- List<ElevationPoint> points = entry.getValue();
- Collections.sort(points);
-
- if (points.size() == 1) {
- ElevationPoint firstPoint = points.get(0);
- ElevationPoint endPoint = new ElevationPoint(edge.getDistance(), firstPoint.ele);
- points.add(endPoint);
- }
- Coordinate[] coords = new Coordinate[points.size()];
- int i = 0;
- for (ElevationPoint p : points) {
- double d = p.distanceAlongShape;
- if (i == 0) {
- d = 0;
- } else if (i == points.size() - 1) {
- d = edge.getDistance();
- }
- coords[i++] = new Coordinate(d, p.ele);
- }
- // set elevation profile and warn if profile was flattened because it was too steep
- if(edge.setElevationProfile(new PackedCoordinateSequence.Double(coords), true)) {
- _log.warn(GraphBuilderAnnotation.register(graph, Variety.ELEVATION_FLATTENED, edge));
- }
- }
-
- applyBikeSafetyFactor(graph);
- StreetUtils.makeEdgeBased(graph, endpoints, turnRestrictions);
-
- } // END buildGraph()
+ }
private void storeExtraElevationData(List<ElevationPoint> elevationPoints, PlainStreetEdge street, PlainStreetEdge backStreet, double length) {
if (elevationPoints.isEmpty()) {
View
10 ...ing/src/main/java/org/opentripplanner/routing/edgetype/factory/GTFSPatternHopFactory.java
@@ -442,6 +442,16 @@ public void run(Graph graph) {
Stop s0 = st0.getStop();
Stop s1 = st1.getStop();
+ if (st0.getPickupType() == 1) {
+ // do not create an interline dwell when
+ // the last stop on the arriving trip does not
+ // allow pickups, since this probably means
+ // that, while two trips share a block,
+ // riders cannot stay on the vehicle during the
+ // deadhead
+ continue;
+ }
+
Trip fromExemplar = fromInterlineTrip.tripPattern.exemplar;
Trip toExemplar = toInterlineTrip.tripPattern.exemplar;

4 comments on commit 2dde4c1

@skywave
Owner

Ik zie nergens een commit die de "default" straatnamen aanpast. Er missen namelijk wat namen in de vertaling, althans sommige staan nu bekend met het OSM way id.
Zie http://opentripplanner.nl/index.html#/submit&fromPlace=52.371213,4.883165&toPlace=52.363038,4.914064&mode=TRANSIT,WALK&min=QUICK&maxWalkDistance=500&time=23:49&date=04-19-2012&arr=Vertrek&itinID=1&wheelchair=false

@joelhaasnoot
@skywave
Owner

Voor de volgende merge, deze commit kan problemen geven.
opentripplanner@f33f857 zet elke tijd om naar 12h time format

@joelhaasnoot
Please sign in to comment.
Something went wrong with that request. Please try again.