TomTom Maps for JavaScript
    Preparing search index...

    Type Alias TrafficAreaAnalytics

    Result from the Traffic Area Analytics Lite service.

    Contains the full traffic analysis for the requested polygon region and time period. Each feature corresponds to the submitted region with aggregated and time-series metrics.

    const result = await trafficAreaAnalytics({
    startDate: new Date('2024-08-06'),
    endDate: new Date('2024-08-06'),
    frcs: [0, 1, 2, 3],
    hours: [7, 8, 9],
    dataTypes: ['SPEED', 'CONGESTION_LEVEL'],
    feature: {
    type: 'Feature',
    geometry: {
    type: 'Polygon',
    coordinates: [[[4.89, 52.37], [4.91, 52.37], [4.91, 52.39], [4.89, 52.39], [4.89, 52.37]]]
    },
    properties: {}
    }
    });

    console.log(result.properties.startDate); // Date object: 2024-08-06T00:00:00.000Z
    result.features[0].properties.baseData.speed; // avg speed in km/h
    type TrafficAreaAnalytics = {
        features: AreaAnalyticsFeature[];
        properties: AreaAnalyticsCollectionProperties;
        type: "FeatureCollection";
    }
    Index

    Properties

    Analysis results, one feature per submitted region.

    Collection-level metadata for the analysis.

    type: "FeatureCollection"