Skip to content

Commit

Permalink
Updated name of the freehand route methods in ORSGraphHopper
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Rousell committed Feb 25, 2019
1 parent 6247c21 commit 3e90ed5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ else if (bearings[1] == null)
req.getHints().put("astarbi.approximation", _astarApproximation);

if (directedSegment) {
resp = mGraphHopper.constructAirLineRoute(req);
resp = mGraphHopper.constructFreeHandRoute(req);
} else {
mGraphHopper.setSimplifyResponse(geometrySimplify);
resp = mGraphHopper.route(req);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,16 @@ protected void cleanUp() {
}


public GHResponse constructAirLineRoute(GHRequest request) {
LineString directRouteGeometry = constructAirLineRouteGeometry(request);
PathWrapper directRoutePathWrapper = constructAirLineRoutePathWrapper(directRouteGeometry);
public GHResponse constructFreeHandRoute(GHRequest request) {
LineString directRouteGeometry = constructFreeHandRouteGeometry(request);
PathWrapper directRoutePathWrapper = constructFreeHandRoutePathWrapper(directRouteGeometry);
GHResponse directRouteResponse = new GHResponse();
directRouteResponse.add(directRoutePathWrapper);
directRouteResponse.getHints().put("skipped_segment", "true");
return directRouteResponse;
}

private PathWrapper constructAirLineRoutePathWrapper(LineString lineString) {
private PathWrapper constructFreeHandRoutePathWrapper(LineString lineString) {
PathWrapper pathWrapper = new PathWrapper();
PointList pointList = new PointList();
PointList startPointList = new PointList();
Expand Down Expand Up @@ -291,7 +291,7 @@ private PathWrapper constructAirLineRoutePathWrapper(LineString lineString) {
return pathWrapper;
}

private LineString constructAirLineRouteGeometry(GHRequest request){
private LineString constructFreeHandRouteGeometry(GHRequest request){
Coordinate start = new Coordinate();
Coordinate end = new Coordinate();
start.x = request.getPoints().get(0).getLat();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ORSGraphHopperTest {
@Test
public void directRouteTest() {
GHRequest ghRequest = new GHRequest(49.41281601436809, 8.686215877532959, 49.410163456220076, 8.687160015106201);
GHResponse ghResponse = new ORSGraphHopper().constructAirLineRoute(ghRequest);
GHResponse ghResponse = new ORSGraphHopper().constructFreeHandRoute(ghRequest);

Assert.assertTrue(ghResponse.getHints().has("skipped_segment"));
Assert.assertTrue(ghResponse.getHints().getBool("skipped_segment", false));
Expand Down

1 comment on commit 3e90ed5

@MichaelsJP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😁

Please sign in to comment.