{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/digitraffic-fi/json-schema/digitraffic-fi-forecast-section-feature-v1-schema.json",
  "title": "ForecastSectionFeatureV1",
  "description": "GeoJSON feature object of forecast section",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/digitraffic-fi-road-api-openapi.yml#/components/schemas/ForecastSectionFeatureV1",
  "required": [
    "geometry",
    "properties",
    "type"
  ],
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "GeoJSON Object Type"
    },
    "id": {
      "type": "string",
      "description": "Forecast section identifier ie. 00004_342_01435_0_274.569: \n1. Road number 5 characters ie. 00004, \n2. Road section 3 characters ie. 342, \n3. Start distance 5 characters ie. 000, \n4. Carriageway 1 character, \n5. Measure value of link start point. Varying number of characters ie. 274.569, \nRefers to Digiroad content at https://aineistot.vayla.fi/digiroad/"
    },
    "geometry": {
      "oneOf": [
        {
          "$ref": "#/$defs/LineString"
        },
        {
          "$ref": "#/$defs/MultiLineString"
        },
        {
          "$ref": "#/$defs/MultiPoint"
        },
        {
          "$ref": "#/$defs/MultiPolygon"
        },
        {
          "$ref": "#/$defs/Point"
        },
        {
          "$ref": "#/$defs/Polygon"
        }
      ]
    },
    "properties": {
      "$ref": "#/$defs/ForecastSectionPropertiesV1"
    }
  },
  "$defs": {
    "ForecastSectionPropertiesV1": {
      "required": [
        "dataUpdatedTime"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Forecast section identifier ie. 00004_342_01435_0_274.569: \n1. Road number 5 characters ie. 00004, \n2. Road section 3 characters ie. 342, \n3. Start distance 5 characters ie. 000, \n4. Carriageway 1 character, \n5. Measure value of link start point. Varying number of characters ie. 274.569, \nRefers to Digiroad content at https://aineistot.vayla.fi/digiroad/"
        },
        "description": {
          "type": "string",
          "description": "Forecast section description"
        },
        "roadSectionNumber": {
          "type": "integer",
          "description": "Road section number",
          "format": "int32"
        },
        "roadNumber": {
          "type": "integer",
          "description": "Forecast section road number",
          "format": "int32"
        },
        "length": {
          "type": "integer",
          "description": "Forecast section length in meters",
          "format": "int32"
        },
        "roadSegments": {
          "type": "array",
          "description": "Forecast section road segments. Refers to https://aineistot.vayla.fi/digiroad/",
          "items": {
            "$ref": "#/$defs/RoadSegmentDtoV1"
          }
        },
        "linkIds": {
          "type": "array",
          "description": "Forecast section link indices. Refers to https://aineistot.vayla.fi/digiroad/",
          "items": {
            "type": "integer",
            "description": "Forecast section link indices. Refers to https://aineistot.vayla.fi/digiroad/",
            "format": "int64"
          }
        },
        "dataUpdatedTime": {
          "type": "string",
          "description": "Date time of the most recent metadata update",
          "format": "date-time"
        }
      },
      "description": "Forecast Section Properties"
    },
    "GeometryObject": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "GeoJson Geometry Object type",
          "enum": [
            "Point",
            "LineString",
            "Polygon",
            "MultiPoint",
            "MultiLineString",
            "MultiPolygon"
          ]
        },
        "coordinates": {
          "type": "array",
          "description": "GeoJson Geometry Object coordinates",
          "items": {
            "type": "object",
            "description": "GeoJson Geometry Object coordinates"
          }
        }
      },
      "description": "GeoJson Geometry Object"
    },
    "LineString": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "description": "GeoJson LineString Geometry Object",
      "allOf": [
        {
          "$ref": "#/$defs/GeometryObject"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "LineString"
              ]
            },
            "coordinates": {
              "type": "array",
              "description": "An array of Point coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
              "items": {
                "type": "array",
                "description": "An array of Point coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                "items": {
                  "type": "number",
                  "description": "An array of Point coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                  "format": "double"
                }
              }
            }
          }
        }
      ]
    },
    "MultiLineString": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "description": "GeoJson MultiLineString Geometry Object",
      "allOf": [
        {
          "$ref": "#/$defs/GeometryObject"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "MultiLineString"
              ]
            },
            "coordinates": {
              "type": "array",
              "description": "An array of LineString coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
              "items": {
                "type": "array",
                "description": "An array of LineString coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                "items": {
                  "type": "array",
                  "description": "An array of LineString coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                  "items": {
                    "type": "number",
                    "description": "An array of LineString coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                    "format": "double"
                  }
                }
              }
            }
          }
        }
      ]
    },
    "MultiPoint": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "description": "GeoJson MultiPoint Geometry Object",
      "allOf": [
        {
          "$ref": "#/$defs/GeometryObject"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "MultiPoint"
              ]
            },
            "coordinates": {
              "type": "array",
              "description": "An array of Point coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
              "items": {
                "type": "array",
                "description": "An array of Point coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                "items": {
                  "type": "number",
                  "description": "An array of Point coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                  "format": "double"
                }
              }
            }
          }
        }
      ]
    },
    "MultiPolygon": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "description": "GeoJson MultiPolygon Geometry Object",
      "allOf": [
        {
          "$ref": "#/$defs/GeometryObject"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "MultiPolygon"
              ]
            },
            "coordinates": {
              "type": "array",
              "description": "An array of Polygon coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
              "items": {
                "type": "array",
                "description": "An array of Polygon coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                "items": {
                  "type": "array",
                  "description": "An array of Polygon coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                  "items": {
                    "type": "array",
                    "description": "An array of Polygon coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                    "items": {
                      "type": "number",
                      "description": "An array of Polygon coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                      "format": "double"
                    }
                  }
                }
              }
            }
          }
        }
      ]
    },
    "Point": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "description": "GeoJson Point Geometry Object",
      "allOf": [
        {
          "$ref": "#/$defs/GeometryObject"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "Point"
              ]
            },
            "coordinates": {
              "type": "array",
              "description": "An array of coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
              "items": {
                "type": "number",
                "description": "An array of coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                "format": "double"
              }
            }
          }
        }
      ]
    },
    "Polygon": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "description": "GeoJson Polygon Geometry Object",
      "allOf": [
        {
          "$ref": "#/$defs/GeometryObject"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "Polygon"
              ]
            },
            "coordinates": {
              "type": "array",
              "description": "An array of LinearRing coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
              "items": {
                "type": "array",
                "description": "An array of LinearRing coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                "items": {
                  "type": "array",
                  "description": "An array of LinearRing coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                  "items": {
                    "type": "number",
                    "description": "An array of LinearRing coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
                    "format": "double"
                  }
                }
              }
            }
          }
        }
      ]
    },
    "RoadSegmentDtoV1": {
      "type": "object",
      "properties": {
        "startDistance": {
          "type": "integer",
          "description": "Road segment start distance",
          "format": "int32"
        },
        "endDistance": {
          "type": "integer",
          "description": "Road segment end distance",
          "format": "int32"
        },
        "carriageway": {
          "type": "integer",
          "description": "Road segment carriageway",
          "format": "int32"
        }
      },
      "description": "Forecast section road segments. Refers to https://aineistot.vayla.fi/digiroad/"
    }
  }
}