Class Veery.Locations

toArray()

Extract an array of Location objects from a history.

  • on Veery.HISTORY_RAW, it returns all geolocation collected
  • on Veery.HISTORY_ROUTEMATCH, it returns successively the start and the end of each trip (StartOfTrip1 at id 1, EndOfTrip1 at id 2, StartOfTrip2 at id 3, ...)

Parameters

none

Returns

Location [ ] array

Usage / Example

Veery.Locations locations = veery.getLocationHistory(Veery.HISTORY_RAW, since, until);
Location[] locs = locations.toArray();
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));
    }
}

-

Veery.Locations locations = veery.getLocationHistory(Veery.HISTORY_ROUTEMATCH, since, until);
Location[] locs = locations.toArray();
if (locs!=null) {
    for (int j = 0 ; j < locs.length-1 ; j += 2) {
        // Start of Trip
        Location locStart = locs[j];
        LatLng latlon = new LatLng(locStart.getLatitude(), locStart.getLongitude());
        mMap.addMarker(new MarkerOptions().position(latlon));

        // End of Trip
        Location locEnd = locs[j+1];
        latlon = new LatLng(locEnd.getLatitude(), locEnd.getLongitude());
        mMap.addMarker(new MarkerOptions().position(latlon));
    }
}

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.