updated routingAPI to make use of tolls and highway booleans
This commit is contained in:
parent
6ae9852206
commit
5af9c2a515
1 changed files with 15 additions and 2 deletions
|
@ -18,10 +18,23 @@ public class HelperFunctions {
|
||||||
return returnArray;
|
return returnArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double[][] routingAPI(double[] startCoords, double[] destinationCoords) {
|
public double[][] routingAPI(double[] startCoords, double[] destinationCoords, Boolean tollsFlag, Boolean hwyFlag) {
|
||||||
//ideally this would return a series of coordinates, but for the sake of the demo it's just
|
//ideally this would return a series of coordinates, but for the sake of the demo it's just
|
||||||
//going to concatenate the start and end into a 2x2 array with just those two steps
|
//going to concatenate the start and end into a 2x2 array with just those two steps
|
||||||
double[][] routeArray = {startCoords, destinationCoords};
|
double[][] routeArray = new double[2][2];
|
||||||
|
if (tollsFlag && hwyFlag) { //provides a result that both avoid tolls and major highways
|
||||||
|
routeArray[0] = startCoords;
|
||||||
|
routeArray[1] = destinationCoords;
|
||||||
|
} else if (tollsFlag && !hwyFlag) { //provides a result that avoids tolls but not major highways
|
||||||
|
routeArray[0] = startCoords;
|
||||||
|
routeArray[1] = destinationCoords;
|
||||||
|
} else if (!tollsFlag && hwyFlag) { //provides a result that does not avoid tolls and does avoid major highways
|
||||||
|
routeArray[0] = startCoords;
|
||||||
|
routeArray[1] = destinationCoords;
|
||||||
|
} else if (!tollsFlag && !hwyFlag) { //provides a result that does not avoid tolls or major highways
|
||||||
|
routeArray[0] = startCoords;
|
||||||
|
routeArray[1] = destinationCoords;
|
||||||
|
}
|
||||||
return routeArray;
|
return routeArray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue