{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "GeoJSON encoding of OGC 17-003 Earth Observation Metadata",
  "description": "Definition of EO Dataset document.  Note that numbers in the instance should not be surrounded by double-quotes to validate against this schema.",
  "$ref": "#/definitions/EarthObservation",
  "definitions": {
    "MetadataInformation": {
      "description": "Subset of Properties",
      "type": "object",
      "properties": {
        "lang": {
          "description": "RFC3066",
          "type": "string",
          "minLength": 2,
          "maxLength": 3
        },
        "updated": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[\\+\\-][0-9]{2}:[0-9]{2})$",
          "format": "date-time"
        },
        "published": {
          "type": "string",
          "format": "date-time"
        },
        "creationDate": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "updated"
      ]
    },
    "DataIdentification": {
      "description": "Subset of Properties",
      "type": "object",
      "properties": {
        "parentIdentifier": {
          "type": "string"
        },
        "doi": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "available": {
          "type": "string"
        },
        "additionalAttributes": {
          "type": "object",
          "minProperties": 1
        }
      },
      "required": [
        "title",
        "identifier",
        "date"
      ]
    },
    "ProcessingInformation": {
      "description": "Subset of ProductInformation",
      "type": "object",
      "properties": {
        "processingLevel": {
          "type": "string",
          "enum": [
            "1A",
            "1B",
            "1C",
            "2",
            "3"
          ]
        },
        "processorName": {
          "type": "string"
        },
        "processorVersion": {
          "type": "string"
        },
        "processingCenter": {
          "description": "Codelist",
          "type": "string"
        },
        "processingDate": {
          "type": "string",
          "format": "date-time"
        },
        "processingMode": {
          "description": "Codelist",
          "type": "string"
        },
        "compositeType": {
          "type": "string"
        },
        "format": {
          "type": "string"
        },
        "productContentsType": {
          "type": "string"
        },
        "processingMethod": {
          "type": "string"
        },
        "processingMethodVersion": {
          "type": "string"
        }
      }
    },
    "Links": {
      "title": "Links",
      "description": "Objects with Links grouped by \"relation\" (i.e. Atom \"rel\" attribute).",
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Links"
          ]
        },
        "qualityReport": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Link"
          }
        },
        "previews": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Link"
          }
        },
        "via": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Link"
          }
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Link"
          }
        },
        "up": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Link"
          }
        },
        "related": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Link"
          }
        },
        "alternates": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Link"
          }
        }
      }
    },
    "Properties": {
      "title": "Properties",
      "type": "object",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "Properties"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "ARCHIVED",
                "PLANNED",
                "ACQUIRED",
                "CANCELLED",
                "FAILED",
                "POTENTIAL",
                "REJECTED",
                "QUALITYDEGRADED"
              ]
            },
            "acquisitionInformation": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/AcquisitionInformation"
              }
            },
            "productInformation": {
              "$ref": "#/definitions/ProductInformation"
            },
            "links": {
              "$ref": "#/definitions/Links"
            },
            "offerings": {
              "description": "OGC 14-055r2",
              "type": "array",
              "items": {
                "$ref": "http://schemas.opengis.net/eo-geojson/1.0/owc-geojson-schema.json#/definitions/Offering"
              }
            }
          },
          "required": [
            "status",
            "acquisitionInformation",
            "links"
          ]
        },
        {
          "$ref": "#/definitions/DataIdentification"
        },
        {
          "$ref": "#/definitions/MetadataInformation"
        }
      ]
    },
    "EarthObservation": {
      "description": "GeoJSON Feature",
      "type": "object",
      "properties": {
        "@context": {
          "type": "string"
        },
        "type": {
          "title": "type",
          "type": "string",
          "enum": [
            "Feature"
          ]
        },
        "id": {
          "type": "string",
          "format": "uri"
        },
        "geometry": {
          "oneOf": [
            {
              "$ref": "http://schemas.opengis.net/eo-geojson/1.0/owc-geojson-schema.json#/definitions/Geometry"
            },
            {
              "type": "null"
            }
          ]
        },
        "properties": {
          "$ref": "#/definitions/Properties"
        },
        "bbox": {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "items": {
            "type": "number"
          }
        }
      },
      "required": [
        "type",
        "id",
        "geometry",
        "properties"
      ],
      "additionalProperties": false
    },
    "Platform": {
      "type": "object",
      "minProperties": 1,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Platform"
          ]
        },
        "id": {
          "type": "string",
          "format": "uri"
        },
        "platformShortName": {
          "type": "string"
        },
        "platformSerialIdentifier": {
          "type": "string"
        },
        "orbitType": {
          "type": "string",
          "enum": [
            "GEO",
            "LEO"
          ]
        }
      },
      "required": [
        "platformShortName"
      ],
      "additionalProperties": false
    },
    "Instrument": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Instrument"
          ]
        },
        "id": {
          "type": "string",
          "format": "uri"
        },
        "sensorType": {
          "type": "string",
          "enum": [
            "OPTICAL",
            "RADAR",
            "ATMOSPHERIC",
            "ALTIMETRIC",
            "LIMB"
          ]
        },
        "instrumentShortName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "instrumentShortName"
      ],
      "additionalProperties": false
    },
    "AcquisitionParameters": {
      "type": "object",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "acquisitionType": {
              "type": "string",
              "enum": [
                "NOMINAL",
                "CALIBRATION",
                "OTHER"
              ]
            },
            "acquisitionSubType": {
              "type": "string"
            },
            "startTimeFromAscendingNode": {
              "type": "integer",
              "minimum": 0
            },
            "completionTimeFromAscendingNode": {
              "type": "integer",
              "minimum": 0
            },
            "relativeOrbitNumber": {
              "type": "integer"
            },
            "wrsLongitude": {
              "type": "string"
            },
            "wrsLatitude": {
              "type": "string"
            },
            "tileId": {
              "type": "string"
            },
            "groundTrackUncertainty": {
              "type": "number"
            },
            "cycleNumber": {
              "type": "integer",
              "minimum": 0
            },
            "antennaLookDirection": {
              "type": "string",
              "enum": [
                "LEFT",
                "RIGHT"
              ]
            },
            "acquisitionStation": {
              "type": "string"
            },
            "acquisitionAngles": {
              "$ref": "#/definitions/AcquisitionAngles"
            },
            "operationalMode": {
              "type": "string"
            },
            "swathIdentifier": {
              "type": "string"
            },
            "polarisationMode": {
              "description": "Sar",
              "type": "string",
              "enum": [
                "S",
                "D",
                "T",
                "Q",
                "UNDEFINED"
              ]
            },
            "polarisationChannels": {
              "description": "Sar",
              "type": "string"
            },
            "resolution": {
              "type": "number"
            },
            "verticalResolution": {
              "description": "Atm, Lmb",
              "type": "number"
            },
            "waveLengths": {
              "type": "array",
              "minItems": 1,
              "items": {
                "$ref": "#/definitions/WavelengthInformation"
              }
            },
            "measurementType": {
              "type": "string",
              "enum": [
                "ABSORPTION",
                "EMISSION"
              ]
            },
            "dopplerFrequency": {
              "description": "Sar",
              "type": "number",
              "minimum": 0,
              "exclusiveMinimum": true
            },
            "samplingRates": {
              "description": "Alt",
              "type": "array",
              "items": {
                "type": "number",
                "minimum": 0,
                "exclusiveMinimum": true
              }
            }
          },
          "required": [
            "acquisitionType"
          ]
        },
        {
          "$ref": "#/definitions/TemporalInformation"
        },
        {
          "$ref": "#/definitions/VerticalSpatialDomain"
        },
        {
          "$ref": "#/definitions/OrbitParameters"
        }
      ]
    },
    "Link": {
      "type": "object",
      "properties": {
        "href": {
          "type": "string",
          "format": "uri"
        },
        "type": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "length": {
          "type": "integer",
          "minimum": 0
        },
        "category": {
          "description": "Media category property defined by MediaRSS.",
          "type": "string",
          "enum": [
            "THUMBNAIL",
            "QUICKLOOK",
            "ALBUM",
            "CLOUD",
            "SNOW",
            "QUALITY"
          ]
        },
        "expression": {
          "description": "Media expression property defined by MediaRSS.",
          "type": "string",
          "enum": [
            "full",
            "sample"
          ]
        },
        "conformsTo": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "href"
      ],
      "additionalProperties": false
    },
    "ProductInformation": {
      "type": "object",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "ProductInformation"
              ]
            },
            "productType": {
              "type": "string"
            },
            "size": {
              "type": "integer"
            },
            "productVersion": {
              "type": "string"
            },
            "statusSubType": {
              "type": "string",
              "enum": [
                "ON-LINE",
                "OFF-LINE"
              ]
            },
            "qualityInformation": {
              "$ref": "#/definitions/QualityInformation"
            },
            "statusDetail": {
              "type": "string"
            },
            "availabilityTime": {
              "type": "string",
              "format": "date-time"
            },
            "timeliness": {
              "type": "string"
            },
            "productGroupId": {
              "type": "string"
            },
            "archivingCenter": {
              "type": "string"
            },
            "referenceSystemIdentifier": {
              "type": "string"
            },
            "archivingDate": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "availabilityTime"
          ]
        },
        {
          "$ref": "#/definitions/ProcessingInformation"
        },
        {
          "$ref": "#/definitions/CoverageDescription"
        }
      ]
    },
    "AcquisitionAngles": {
      "type": "object",
      "properties": {
        "illuminationAzimuthAngle": {
          "type": "number"
        },
        "illuminationZenithAngle": {
          "type": "number"
        },
        "illuminationElevationAngle": {
          "type": "number"
        },
        "incidenceAngle": {
          "type": "number"
        },
        "minimumIncidenceAngle": {
          "type": "number"
        },
        "maximumIncidenceAngle": {
          "type": "number"
        },
        "incidenceAngleVariation": {
          "type": "number"
        },
        "acrossTrackIncidenceAngle": {
          "type": "number"
        },
        "alongTrackIncidenceAngle": {
          "type": "number"
        },
        "instrumentAzimuthAngle": {
          "type": "number"
        },
        "instrumentZenithAngle": {
          "type": "number"
        },
        "instrumentElevationAngle": {
          "type": "number"
        },
        "pitch": {
          "type": "number"
        },
        "roll": {
          "type": "number"
        },
        "yaw": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "QualityInformation": {
      "type": "object",
      "properties": {
        "qualityStatus": {
          "type": "string",
          "enum": [
            "NOMINAL",
            "DEGRADED"
          ]
        },
        "qualityDegradation": {
          "description": "Percentage",
          "type": "number"
        },
        "qualityDegradationTag": {
          "type": "string"
        },
        "qualityDegradationQuotationMode": {
          "type": "string",
          "enum": [
            "AUTOMATIC",
            "MANUAL"
          ]
        }
      },
      "additionalProperties": true
    },
    "CoverageDescription": {
      "description": "Subset of ProductInformation",
      "type": "object",
      "properties": {
        "cloudCover": {
          "type": "number"
        },
        "snowCover": {
          "type": "number"
        }
      }
    },
    "FeatureCollection": {
      "description": "GeoJSON FeatureCollection",
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "FeatureCollection"
          ]
        },
        "bbox": {
          "type": "array"
        },
        "features": {
          "type": "array",
          "minItems": 0,
          "items": {
            "$ref": "#/definitions/EarthObservation"
          }
        }
      },
      "required": [
        "type",
        "features"
      ]
    },
    "WavelengthInformation": {
      "type": "object",
      "minProperties": 1,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "WavelengthInformation"
          ]
        },
        "discreteWavelengths": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true
          }
        },
        "endWavelength": {
          "type": "number",
          "minimum": 0,
          "exclusiveMinimum": true
        },
        "spectralRange": {
          "type": "string",
          "enum": [
            "INFRARED",
            "NIR",
            "SWIR",
            "MWIR",
            "LWIR",
            "FIR",
            "UV",
            "VISIBLE",
            "MICROWAVE",
            "OTHER"
          ]
        },
        "startWavelength": {
          "type": "number",
          "minimum": 0,
          "exclusiveMinimum": true
        },
        "wavelengthResolution": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "VerticalSpatialDomain": {
      "description": "Subset of AcquisitionParameters",
      "type": "object",
      "properties": {
        "highestLocation": {
          "type": "string"
        },
        "lowestLocation": {
          "type": "string"
        },
        "locationUnit": {
          "type": "string",
          "enum": [
            "bar",
            "m"
          ]
        }
      }
    },
    "TemporalInformation": {
      "description": "Subset of AcquisitionParameters",
      "type": "object",
      "properties": {
        "beginningDateTime": {
          "type": "string",
          "format": "date-time"
        },
        "endingDateTime": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "beginningDateTime",
        "endingDateTime"
      ]
    },
    "AcquisitionInformation": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AcquisitionInformation"
          ]
        },
        "platform": {
          "$ref": "#/definitions/Platform"
        },
        "instrument": {
          "$ref": "#/definitions/Instrument"
        },
        "acquisitionParameters": {
          "$ref": "#/definitions/AcquisitionParameters"
        }
      }
    },
    "OrbitParameters": {
      "description": "Subset of AcquisitionParameters",
      "type": "object",
      "properties": {
        "orbitDirection": {
          "type": "string",
          "enum": [
            "ASCENDING",
            "DESCENDING"
          ]
        },
        "lastOrbitDirection": {
          "type": "string",
          "enum": [
            "ASCENDING",
            "DESCENDING"
          ]
        },
        "orbitDuration": {
          "type": "integer"
        },
        "ascendingNodeDate": {
          "type": "string",
          "format": "date-time"
        },
        "ascendingNodeLongitude": {
          "type": "number"
        },
        "orbitNumber": {
          "type": "integer",
          "minimum": 0
        },
        "lastOrbitNumber": {
          "type": "number"
        }
      }
    }
  }
}
