Speeding report

Overview

Analyze speeding with Speeding report function. Speeding report can be enhanced using time stamp and GPS accuracy data.

Live Example

This example demonstrates the use of the Speeding report function. Click on icons to see code on Github or play with it in JSFiddle:

  • Legend:
    blue for no speeding (0%)
    yellow for 10% speeding
    orange for 20% speeding
    red for 30% speeding
    black for more

    Request

    API Reference

    https://analytics.api.sygic.com/v0/api/speeding?key=yourAPIkey

    Request authentication is done via parameter key, which must be included in the request URL.

    Methods

    • POST

    Parameters

    Required Parameters

    Parameter Data type Description
    coordinates array of strings Set of GPS coordinates for speeding

    Example: "coordinates": ["48.37362,17.595033","48.37397,17.59686"]

    Optional Parameters

    Parameter Data type Description
    accuracies array of decimal values Set of radiuses of uncertainty for the corresponding locations, measured in meters. This field is not required. When ommitted, default values for best results will be used.

    Example: "accuracies": [9,10]
    speeds array of integers Set of the speeds for corresponding locations.

    Example: "speeds": [48,48,48]
    timestamps array of integers Set of timestamps in seconds since midnight, January 1, 1970 UTC.

    Example: "timestamps":[1464691627,1464691698]
    units string Units’ format. Default value is "metric".

    Values: metric, imperial

    If provided, number of accuracies, speeds and timestamps must match number of coordinates.
    Parameters with default value don't have to be included in the request.

    Response

    POST

    POST https://analytics.api.sygic.com/v0/api/speeding?key=yourAPIkey
    
    Content-Type: application/json

    Request Body

    {
        "coordinates": [
            "51.32107,-0.761935",
            "51.321026,-0.76222",
            "51.321056,-0.762356",
            "51.321327,-0.762678",
            "51.321327,-0.762678",
            "51.321335,-0.762686",
            "51.322136,-0.763151",
            "51.322205,-0.763136"
        ],
        "accuracies": [
            9,9,10,11,9,10,11,10
        ],
        "speeds": [
            84,50,80,80,90,60,110,100
        ]
    }

    Response Body

    {
        "route": "krfxHzzsC??eBnB]J[Cc@n@sAGYZ",
        "speeding_segments": [
            {
                "max_speed": 97,
                "speeding": 1,
                "route": "sqfxHzrsCAbALbBEb@]r@eBnB]J",
                "original_coordinates": [
                    "51.32107,-0.76194",
                    "51.32103,-0.76222",
                    "51.32106,-0.76236",
                    "51.32133,-0.76268",
                    "51.32133,-0.76268",
                    "51.32134,-0.76269"
                ],
                "snapped_coordinates": [
                    "51.32086,-0.76222",
                    "51.32093,-0.76230",
                    "51.32101,-0.76239",
                    "51.32130,-0.76271",
                    "51.32130,-0.76271",
                    "51.32131,-0.76272"
                ],
                "original_speeds": [
                    84,
                    50,
                    80,
                    80,
                    90,
                    60
                ]
            },
            {
                "max_speed": 97,
                "speeding": 1.1,
                "route": "kwfxHr~sCc@n@sAGYZ",
                "original_coordinates": [
                    "51.32214,-0.76315",
                    "51.32220,-0.76314"
                ],
                "snapped_coordinates": [
                    "51.32213,-0.76303",
                    "51.32219,-0.76302"
                ],
                "original_speeds": [
                    110,
                    100
                ]
            }
        ],
        "distance": {
            "value": 189,
            "text": "0.19 km"
        },
        "status": "OK",
        "copyright": "© 2018 Sygic a.s."
    }

    Response Properties

    Property Data type Description
    route string Continuous route matched to map and created from input data

    Example: "route": "ubhxH~nqCuEiL}CoHwCwGwLgWeK}R"
    speeding_segments array of objects Continuous segments of the route matched on map, grouped by max speed, speeding and continuity of segments.
    distance integer Calculated distance of matched continuous route.

    Speeding segment properties:

    Property Data type Description
    max_speed integer General speed limit on matched segment.

    Example: "max_speed": 97
    speeding integer Relative speeding expressed by decimal number rounded to one decimal (20% speeding ~ 1.2)

    Example: "speeding": 1.2
    route string Geometry of matched segment.

    Example: "route": "ezexHjjsCh@Il@i@??Xi@Pu@FyAEY"
    original_coordinates array of strings Coordinates from input used to calculate current segment.

    Example: "original_coordinates": [ "51.31689,-0.75947", "51.31677,-0.75942", "51.31639,-0.75887" ]
    snapped_coordinates array of strings Coordinates snapped to road network.

    Example: "snapped_coordinates": [ "51.31687,-0.75955", "51.31671,-0.75947", "51.31634,-0.75888" ]
    original_speeds array of integers Respective speeds from original collection.

    Example: "original_speeds": [ 113, 113,113 ]
    is_implicit boolean Flag indicates whether an implicit speed limit per country is used (urban/rural/highway roads)

    Example: "is_implicit": false