Class Veery.Predictions

toLocations()

Get the next predicted as an array of Location objects.

Parameters

none

Returns

Location [ ] array

Usage / Example

if (veery.getNextTrip().isOK() &&
    !veery.getNextTrip().isOutdated() &&
    veery.getNextTrip().getProbability()>0.5 ) {

    Veery.Predictions predictions = veery.getNextTrip();

    Location[] locs = predictions.toLocations();
    if (locs!=null) {
        for (int j = 0 ; j < locs.length; j ++) {
            Location loc = locs[j];
            LatLng latlon = new LatLng(loc.getLatitude(), loc.getLongitude());
            mMap.addMarker(new MarkerOptions().position(latlon));
        }
    }
}

User interaction

none

See also

getNextTrip

Get the next estimated trip for that user.

requestPredictionUpdate

Request for a callback event when a new prediction is computed by the Veery Backend.

stopPredictionUpdate

Cancel the call to requestPredictionUpdate.

Predictions.isOK

Return true if a prediction is in the Cache.

Predictions.isOutdated

Return true if the prediction is outdated (made previously, but now concerns a time in the past)

Predictions.getProbability

Get the level of certainty of the predictive algorithm.

Predictions.getDestinationLongitude getDestinationLatitude

Get the coordinates of the next predicted destination

Predictions.getTrip toGeojson

Get the next predicted trip in GeoJSON format.

Predictions.toLocations

Get the next trip in the form of a Location array.

Predictions.getStartTrip

Get the next start point of the prediction.

Predictions.getStartTime

Get the estimated start time predicted for the next trip.

Predictions.getStartName

Get the name (street name) of the predicted departure place.

Predictions.getArrivalTime

Get the estimated arrival time predicted for the next trip.

Predictions.getArrivalTimeUTC

Get the estimated arrival time predicted for the next trip (returns EPOCH).

Predictions.getArrivalName

Get the name (street name) of the predicted arrival place.

PredictionUpdate.onPredictionUpdate

Callback triggered every time a new prediction is computed by the Veery backend.