User's next predicted trip
This section describes how to get the next predicted trip of a user as estimated by the Veery geoprofiling algorithms (IOS native).
Predictions are only computed if veery was activated using Veery.PREDICTION parameter.
The Predictions are computed regularly and sent to the Veery Cache. It is therefore necessary to verify if the prediction you get is not outdated (this could also happen if the network was unavailable when the prediction was made)
It is possible to simply request for the last known prediction using the getNextTrip function but it is also possible to get warned when a new prediction have been recalculated using the function requestPredictionUpdate.
Predictions are delivered with a "Probability" which represent the percentage certainty of the predictive algorithms.
Veery Functions
getNextTrip
Get 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.
Veery sub-classes
Veery.Predictions
Subclass of Veery reprsenting users trips 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)
getProbability
Get the level of certainty of the predictive algorithm.
getNextDestination
Get the coordinates of the next predicted destination
Predictions.toGeojson
Get the next predicted trip in GeoJSON format.
toLocations
Get the next trip in the form of a Location array.
toLocationCoordinate2D
Get the next trip in the form of a CLLocationCoordinate2D array.
getStartTrip
Get the next start point of the prediction.
getStartTime
Get the estimated start time predicted for the next trip.
getStartName
Get the name (street name) of the predicted departure place.
getArrivalTime
Get the estimated arrival time predicted for the next trip.
getArrivalName
Get the name (street name) of the predicted arrival place.
Veery Delegate
veeryPredictionUpdate
Callback triggered every time a new prediction is computed by the Veery backend.