{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openssom.org/schema/profile-geographic-position-observation.json",
  "title": "SSOM Mobile Asset Profile: Geographic Position Observation",
  "description": "One position fix of a mobile asset as one Observation whose value is a structured position.",
  "allOf": [
    {
      "$ref": "observation.json"
    }
  ],
  "type": "object",
  "required": [
    "metric",
    "value"
  ],
  "properties": {
    "metric": {
      "const": "geographic_position"
    },
    "value": {
      "type": "object",
      "required": [
        "latitude",
        "longitude",
        "crs"
      ],
      "properties": {
        "latitude": {
          "type": "number",
          "minimum": -90,
          "maximum": 90
        },
        "longitude": {
          "type": "number",
          "minimum": -180,
          "maximum": 180
        },
        "altitude_m": {
          "type": "number"
        },
        "crs": {
          "type": "string",
          "pattern": "^EPSG:[0-9]+$"
        },
        "horizontal_accuracy_m": {
          "type": "number",
          "minimum": 0
        },
        "heading_deg": {
          "type": "number",
          "minimum": 0,
          "exclusiveMaximum": 360
        },
        "fix_type": {
          "type": "string",
          "enum": [
            "gnss",
            "rtk",
            "dead_reckoning",
            "beacon",
            "manual"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}
