This repository was archived by the owner on Nov 26, 2021. It is now read-only.
This repository was archived by the owner on Nov 26, 2021. It is now read-only.
TravelTimePredictionExample wrong GeoUtils usage for direction #32
Open
Description
Hi,
i think i have found a small problem in the example.
This commit in my fork contains the fix.
The line
int direction = GeoUtils.getDirectionAngle(ride.endLon, ride.endLat, ride.startLon, ride.startLat);
should be
int direction = GeoUtils.getDirectionAngle(ride.startLon, ride.startLat, ride.endLon, ride.endLat);
because the GeoUtils API says
/**
* Returns the angle in degrees between the vector from the start to the destination
* and the x-axis on which the start is located.
*
* The angle describes in which direction the destination is located from the start, i.e.,
* 0° -> East, 90° -> South, 180° -> West, 270° -> North
*
* @param startLon longitude of start location
* @param startLat latitude of start location
* @param destLon longitude of destination
* @param destLat latitude of destination
* @return The direction from start to destination location
*/
public static int getDirectionAngle(
float startLon, float startLat, float destLon, float destLat)
Or maybe I am wrong? Looking forward for feedback, thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels