Class Veery
getLocationHistory(int format, Long since, Long unti)
Get the historical geolocation data for the mentioned period.
The format parameter defines the type of historical data the set returned will be filled with : RAW or ROUTEMATCH.
Parameters
Param name | Type | Possible Values / Usage |
---|---|---|
format | int | Veery.HISTORY_RAW : Will return the strictly the data collected |
Veery.HISTORY_ROUTEMATCH : Will return an enhanced version of the data collected representing the estimated trips that the Veery BACKEND or the Veery GEOPROFILE algorithms have deducted from the data. Using the GEOPROFILE activate mode, the trips is computed considering similar days and trips as well as traffic jams and train timetables to compensate the absence of geolocation data during the trips. | ||
since | Long | Represent the time of the beginning of the historical period required. Format is the EPOCH in millis as returned by Calendar.getTimeInMillis() |
null could be used for "since the beginning" | ||
until | Long | Represent the time of the end of the historical period required. Format is the EPOCH in millis as returned by Calendar.getTimeInMillis() |
null could be used for "until the end" |
Returns
Veery.Locations object
Usage / Example
The following example prints the geolocation history to a mMap Google Maps object
Calendar calendar = Calendar.getInstance(); // now Long until = calendar.getTimeInMillis(); calendar.add(Calendar.HOUR, -3); // three hours ago Long since = calendar.getTimeInMillis(); Veery.Locations locations = veery.getLocationHistory(Veery.HISTORY_RAW, since, until); JSONObject geoJsonData1 = locations.toGeoJSON(veery.GEOJSON_MULTIPOINT); if (geoJsonData1 != null) { GeoJsonLayer layer = new GeoJsonLayer(mMap, geoJsonData1); // see Google Maps API setGeoJsonStyle(layer); layer.addLayerToMap(); LatLngBounds latLngBounds = Veery.getBoundingBox(layer); if (latLngBounds != null && bMapReady) mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds,100)); }
Info
GeoJsonLayer classes are available on Google Maps API
User interaction
none
See also
getLocationHistory
Get the historical geolocation data for the mentioned period.
countLocationHistory
Count Historical data of Geolocations observed during a given period of time.
requestRouteMatch
Request for a callback event when a new trip is routematched by the Veery Backend.
Locations.toArray
Return an array of Location object.
Locations.toGeoJSON
Return a GeoJSON containing the set of locations (Point or MultiLineString).
Locations.toGeoJSONArray
Return an array of GeoJSON.
Locations.getBoundingBox
Get the bounding box which envelopes all locations in the set.
RouteMatch.onRouteMatch
Callback triggered every time a trip is computed by the Veery backend.