{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/digitraffic-fi/json-schema/digitraffic-fi-weathercam-station-feature-v1-detailed-schema.json",
  "title": "WeathercamStationFeatureV1Detailed",
  "description": " Weathercam station GeoJSON feature object with detailed information",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/digitraffic-fi-weathercam-v1-api-openapi.yml#/components/schemas/WeathercamStationFeatureV1Detailed",
  "required": [
    "geometry",
    "id",
    "properties",
    "type"
  ],
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "GeoJSON Object Type"
    },
    "id": {
      "type": "string",
      "description": "Id of the road station"
    },
    "geometry": {
      "$ref": "#/$defs/Point"
    },
    "properties": {
      "$ref": "#/$defs/WeathercamStationPropertiesDetailedV1"
    }
  },
  "$defs": {
    "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"
    },
    "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"
              }
            }
          }
        }
      ]
    },
    "StationRoadAddressV1": {
      "type": "object",
      "properties": {
        "roadNumber": {
          "type": "integer",
          "description": "Road number (values 1–99999)",
          "format": "int32"
        },
        "roadSection": {
          "type": "integer",
          "description": "Road section (values 1–999)",
          "format": "int32"
        },
        "distanceFromRoadSectionStart": {
          "type": "integer",
          "description": "Distance from start of the road portion [m]",
          "format": "int32"
        },
        "carriageway": {
          "type": "string",
          "description": "Carriageway <br>ONE_CARRIAGEWAY:                                0 = One carriageway road section <br>DUAL_CARRIAGEWAY_RIGHT_IN_INCREASING_DIRECTION: 1 = Dual carriageway's right carriageway on increasing direction <br>DUAL_CARRIAGEWAY_LEFT_IN_INCREASING_DIRECTION:  2 = Dual carriageway's left carriageway on increasing direction (upstream)",
          "enum": [
            "ONE_CARRIAGEWAY",
            "DUAL_CARRIAGEWAY_RIGHT_IN_INCREASING_DIRECTION",
            "DUAL_CARRIAGEWAY_LEFT_IN_INCREASING_DIRECTION"
          ]
        },
        "side": {
          "type": "string",
          "description": "Road address side information <br>* UNKNOWN: 0 = Unknown, <br>* RIGHT    1 = On the right side of the carriageway in the increasing direction, <br>* LEFT:    2 = On the left side of the carriageway in the increasing direction, <br>* BETWEEN: 3 = Between the carriageways, <br>* END:     7 = At the end of the road, <br>* MIDDLE:  8 = In the middle of the carriageway / on the carriageway, <br>* CROSS:   9 = Across the road",
          "enum": [
            "UNKNOWN",
            "RIGHT",
            "LEFT",
            "BETWEEN",
            "END",
            "MIDDLE",
            "CROSS"
          ]
        },
        "contractArea": {
          "type": "string",
          "description": "Road contract area"
        },
        "contractAreaCode": {
          "type": "integer",
          "description": "Road contract area code",
          "format": "int32"
        }
      },
      "description": "Road station road address"
    },
    "WeathercamPresetDetailedV1": {
      "required": [
        "direction",
        "directionCode"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of preset"
        },
        "presentationName": {
          "type": "string",
          "description": "PresentationName (Preset name 1, direction)"
        },
        "inCollection": {
          "type": "boolean",
          "description": "Is preset in collection"
        },
        "resolution": {
          "type": "string",
          "description": "Resolution of camera [px x px]"
        },
        "directionCode": {
          "type": "string",
          "description": "Preset direction:<br>\n0 = Unknown direction.<br>\n1 = According to the road register address increasing direction. I.e. on the road 4 to Lahti, if we are in Korso.<br>\n2 = According to the road register address decreasing direction. I.e. on the road 4 to Helsinki, if we are in Korso.<br>\n3 = Increasing direction of the crossing road.<br>\n4 = Decreasing direction of the crossing road.<br>\n5-99 = Special directions"
        },
        "imageUrl": {
          "type": "string",
          "description": "Image url"
        },
        "direction": {
          "$ref": "#/$defs/WeathercamPresetDirectionV1"
        }
      },
      "description": "Weathercam preset object with detailed information"
    },
    "WeathercamPresetDirectionV1": {
      "type": "string",
      "description": "Weathercam preset direction",
      "default": "UNKNOWN",
      "enum": [
        "UNKNOWN",
        "INCREASING_DIRECTION",
        "DECREASING_DIRECTION",
        "CROSSING_ROAD_INCREASING_DIRECTION",
        "CROSSING_ROAD_DECREASING_DIRECTION",
        "SPECIAL_DIRECTION"
      ]
    },
    "WeathercamStationPropertiesDetailedV1": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of the road station"
        },
        "name": {
          "type": "string",
          "description": "Common name of road station"
        },
        "cameraType": {
          "type": "string",
          "description": "Type of camera",
          "enum": [
            "VAPIX",
            "VMX_MPC",
            "VMX_MPH",
            "D_LINK",
            "ZAVIO",
            "ENEO",
            "BOSCH",
            "SONY",
            "HIKVISION",
            "OLD"
          ]
        },
        "nearestWeatherStationId": {
          "type": "integer",
          "description": "Nearest weather station id",
          "format": "int64"
        },
        "collectionStatus": {
          "type": "string",
          "description": "Data collection status",
          "enum": [
            "GATHERING",
            "REMOVED_TEMPORARILY",
            "REMOVED_PERMANENTLY"
          ]
        },
        "state": {
          "type": "string",
          "description": "Road station state",
          "enum": [
            "OK",
            "OK_FAULT_DOUBT_CANCELLED",
            "FAULT_DOUBT",
            "FAULT_CONFIRMED",
            "FAULT_CONFIRMED_NOT_FIXED_IN_NEAR_FUTURE",
            "REPAIR_REQUEST_POSTED",
            "REPAIR_MAINTENANCE_DONE",
            "REPAIR_INTERRUPTED"
          ]
        },
        "dataUpdatedTime": {
          "type": "string",
          "description": "Date time of the most recent metadata update",
          "format": "date-time"
        },
        "collectionInterval": {
          "type": "integer",
          "description": "Data collection interval [s]",
          "format": "int32"
        },
        "names": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "Map of names [fi, sv, en]"
          },
          "description": "Map of names [fi, sv, en]"
        },
        "roadAddress": {
          "$ref": "#/$defs/StationRoadAddressV1"
        },
        "liviId": {
          "type": "string",
          "description": "Id in road registry"
        },
        "country": {
          "type": "string",
          "description": "Country where station is located"
        },
        "startTime": {
          "type": "string",
          "description": "Station established date time",
          "format": "date-time"
        },
        "repairMaintenanceTime": {
          "type": "string",
          "description": "Repair maintenance date time",
          "format": "date-time"
        },
        "annualMaintenanceTime": {
          "type": "string",
          "description": "Annual maintenance date time",
          "format": "date-time"
        },
        "purpose": {
          "type": "string",
          "description": "Purpose of the road station"
        },
        "municipality": {
          "type": "string",
          "description": "Municipality"
        },
        "municipalityCode": {
          "type": "integer",
          "description": "Municipality code",
          "format": "int32"
        },
        "province": {
          "type": "string",
          "description": "Province"
        },
        "provinceCode": {
          "type": "integer",
          "description": "Province code",
          "format": "int32"
        },
        "presets": {
          "type": "array",
          "description": "Weathercam presets",
          "items": {
            "$ref": "#/$defs/WeathercamPresetDetailedV1"
          }
        }
      },
      "description": "Weathercam station properties object with detailed information"
    }
  }
}