Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PT Use Weights #58

Merged
merged 13 commits into from
Apr 19, 2022
Prev Previous commit
Next Next commit
fix compile errors
  • Loading branch information
abhumbla committed Apr 19, 2022
commit 88e47ad304ddca7d65d114daccf6adef2c9668b7
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public long calcEdgeMillis(EdgeIteratorState edgeState, boolean reverse) {
reverse = false;
}

// TODO: find out why this is triggering on interpolated legs
// if (reverse && !edgeState.getReverse(accessEnc) || !reverse && !edgeState.get(accessEnc))
// throw new IllegalStateException("Calculating time should not require to read speed from edge in wrong direction. " +
// "(" + edgeState.getBaseNode() + " - " + edgeState.getAdjNode() + ") "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ public Response doGet(
GeometryFactory geometryFactory = new GeometryFactory();
final FlagEncoder footEncoder = encodingManager.getEncoder(connectingProfileName);
final Weighting weighting = new FastestWeighting(footEncoder);
final PtWeighting ptWeighting = new PtWeighting(PtWeighting.DEFAULT_BETA_PT_EDGE_TIME);
DefaultSnapFilter snapFilter = new DefaultSnapFilter(weighting, graphHopperStorage.getEncodingManager().getBooleanEncodedValue(Subnetwork.key(connectingProfileName)));

boolean isBike = connectingProfileName.contains("bike");

PtLocationSnapper.Result snapResult = new PtLocationSnapper(graphHopperStorage, locationIndex, gtfsStorage).snapAll(Arrays.asList(location), Arrays.asList(snapFilter));
GraphExplorer graphExplorer = new GraphExplorer(snapResult.queryGraph, gtfsStorage.getPtGraph(), weighting, ptWeighting, gtfsStorage, RealtimeFeed.empty(), reverseFlow, false, false, isBike, reverseFlow, blockedRouteTypes);
GraphExplorer graphExplorer = new GraphExplorer(snapResult.queryGraph, gtfsStorage.getPtGraph(), weighting, gtfsStorage, RealtimeFeed.empty(), reverseFlow, false, false, isBike, reverseFlow, blockedRouteTypes);
MultiCriteriaLabelSetting router = new MultiCriteriaLabelSetting(graphExplorer, reverseFlow, false, false, 0, Collections.emptyList());

Map<Coordinate, Double> z1 = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public ObjectNode route(@QueryParam("point") @Size(min=2,max=2) List<GHLocationP
Optional.ofNullable(connectingProfile).ifPresent(request::setConnectingProfile);
Optional.ofNullable(betaTransfers).ifPresent(request::setBetaTransfers);
Optional.ofNullable(betaStreetTime).ifPresent(request::setBetaStreetTime);
Optional.ofNullable(betaPtEdgeTime).ifPresent(request::setBetaPtEdgeTime);
Optional.ofNullable(enableElevation).ifPresent(request::setEnableElevation);
Optional.ofNullable(pathDetails).ifPresent(request::setPathDetails);

Expand Down