Skip to content

Fixes bug where the only points involved in computePointAtDistanceThreshold #5

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ graphhopper:
# More are: surface,smoothness,max_width,max_height,max_weight,max_weight_except,hgv,max_axle_load,max_length,
# hazmat,hazmat_tunnel,hazmat_water,lanes,osm_way_id,toll,track_type,mtb_rating,hike_rating,horse_rating,
# country,curvature,average_slope,max_slope,car_temporal_access,bike_temporal_access,foot_temporal_access
graph.encoded_values: car_access, car_average_speed
graph.encoded_values: car_access, car_average_speed, road_access

#### Speed, hybrid and flexible mode ####

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@ private PointList computePointAtDistanceThreshold(BufferFeature startFeature, Do
EdgeIteratorState finalState = graph.getEdgeIteratorState(endFeature.getEdge(), Integer.MIN_VALUE);
PointList pointList = finalState.fetchWayGeometry(FetchMode.PILLAR_ONLY);

// It is possible that the finalState.fetchWayGeometry(FetchMode.xxxx) would
// only contain TOWER points and not PILLAR points.
// When this happens, filtering by FetchMode.PILLAR_ONLY will return an empty
// PointList.
if (pointList.isEmpty()) {
return pointList;
}

// When the buffer is only as wide as a single edge, truncate one half of the
// segment
if (startFeature.getEdge().equals(endFeature.getEdge())) {
Expand Down