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/v1/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".
    Determines units for: input attribute speeds; output attributes estimated_average_speed; and text of distance attribute. Attribute value is always in meters.

    Values: metric, imperial
    include_estimated_segments boolean Attribute indicates whether the timestamps array should be used to estimate speed in segments, where no points could be matched. In such segments, there will be a new estimated_average_speed property.

    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/v1/api/speeding?key=yourAPIkey
    
    Content-Type: application/json
    {
        "coordinates": ["48.18087,17.19454", "48.18298,17.19728", "48.18595,17.20209", "48.18705,17.20424"],
        "timestamps": [1553155199, 1553155200, 1553155215, 1553155280],
        "accuracies": [10, 9, 10, 8],
        "speeds": [100, 85, 100, 92],
        "include_estimated_segments": true,
    }

    Response Body

    {
        "route": "miaeHwh}gBeAqAoCuDcF_Ia@q@kD{FmDyGkDqHKUsIsSkEeL",
        "speeding_segments": [
            {
                "max_speed": 90,
                "speeding": 1.11,
                "route": "miaeHwh}gBeAqAoCuDcF_I",
                "snapped_coordinates": [
                    "48.18087,17.19452",
                    "48.18297,17.19728"
                ],
                "is_highway": true,
                "is_urban": false,
                "distance": 326,
                "original_indices": [
                    0,
                    1
                ]
            },
            {
                "max_speed": 90,
                "speeding": 1.22,
                "route": "gwaeH_{}gBa@q@kD{FmDyGkDqHKU",
                "snapped_coordinates": [],
                "is_highway": true,
                "is_urban": false,
                "distance": 459,
                "estimated_average_speed": 110,
                "original_indices": []
            },
            {
                "max_speed": 90,
                "speeding": 1.11,
                "route": "{hbeHow~gBsIsSkEeL",
                "snapped_coordinates": [
                    "48.18594,17.20208",
                    "48.18705,17.20423"
                ],
                "is_highway": true,
                "is_urban": false,
                "distance": 502,
                "original_indices": [
                    2,
                    3
                ]
            }
        ],
        "distance": {
            "value": 1287,
            "text": "1.29 km"
        },
        "status": "OK",
        "copyright": "© 2019 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 two decimals (20% speeding ~ 1.21)

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

    Example: "route": "ezexHjjsCh@Il@i@??Xi@Pu@FyAEY"
    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" ]
    is_highway boolean Flag indicates whether the speeding segment is on a highway.
    is_urban boolean Flag indicates whether the speeding segment is in a city.
    distance integer Length of the speeding segment in meters.
    estimated_average_speed integer Estimated average speed of a speeding segment calculated from timestamps array provided as input.
    original_indices array of integers Indices to the input array of coordinates, speeds and timestamps used in the current segment.