{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zh-ch/json-schema/zh-ch-agg-vdp-schema.json",
  "title": "AggVdp",
  "description": "Aggregations calculated from vehicle data in vdp format.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zh-ch-traffic-counts-openapi.yml#/components/schemas/AggVdp",
  "type": "object",
  "properties": {
    "uniqueId": {
      "$ref": "#/$defs/UniqueId"
    },
    "intBegin": {
      "type": "integer",
      "description": "Begin of calculation. Time in [ms] since unix epoche.",
      "format": "int64"
    },
    "intDuration": {
      "type": "integer",
      "description": "Duration of calculation in [ms]",
      "format": "int32"
    },
    "statistics": {
      "type": "array",
      "description": "Calculated statistic details",
      "items": {
        "$ref": "#/$defs/AggVdpDetail"
      }
    }
  },
  "$defs": {
    "AggVdpDetail": {
      "type": "object",
      "properties": {
        "aggClass": {
          "type": "string",
          "description": "Aggregation class. Can be one of the following values\n<ul><li>AGG2CLASS_BUS: Bus</li>\n<li>AGG2CLASS_MR: Motorcycle</li>\n<li>AGG2CLASS_PW: Passenger car</li>\n<li>AGG2CLASS_PWA: Passenger car with trailer</li>\n<li>AGG2CLASS_LFW: Delivery van</li>\n<li>AGG2CLASS_LFWA: Delivery van with trailer</li>\n<li>AGG2CLASS_LFWAL: Delivery van with semitrailer</li>\n<li>AGG2CLASS_LKW: Truck</li>\n<li>AGG2CLASS_LZ: Lorry train</li>\n<li>AGG2CLASS_SZ: Semitrailer</li>\n<li>AGG2CLASS_ALL: All classes</li>\n<li>AGG2CLASS_UNDEFINED: Undefined classes</li>\n<li>AGG2CLASS_HEAVY: Heavy vehicles</li>\n<li>AGG2CLASS_NOISY: Noisy vehicles</li></ul>\n"
        },
        "flow": {
          "type": "integer",
          "description": "Number of vehicles per hour.",
          "format": "int32"
        },
        "count": {
          "type": "integer",
          "description": "Number of vehicles having speed information.",
          "format": "int32"
        },
        "countAll": {
          "type": "integer",
          "description": "Number of vehicles. Vehicles are counted regardless of whether speed information is available or not.",
          "format": "int32"
        },
        "avg": {
          "type": "number",
          "description": "Average speed in km/h. Calculated only based on vehicles having speed information.",
          "format": "float"
        },
        "sDeviation": {
          "type": "number",
          "description": "Standard deviation of average speed.",
          "format": "float"
        },
        "q15": {
          "type": "number",
          "description": "15 percent quantile of speed.",
          "format": "float"
        },
        "q50": {
          "type": "number",
          "description": "50 percent quantile of speed.",
          "format": "float"
        },
        "q85": {
          "type": "number",
          "description": "85 percent quantile of speed.",
          "format": "float"
        }
      },
      "description": "Calculated details in Vdp format."
    },
    "UniqueId": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Root id, e.g. collectors id"
        },
        "sub": {
          "$ref": "#/$defs/UniqueId"
        }
      },
      "description": "Recursive id of object."
    }
  }
}