{
  "name": "HazardArea",
  "description": "An area of an assumed hazard, such as one band of an assumed flood depth, from the hazard maps that the national government, prefectures and municipalities publish. More rules: https://models.geolonia.com/schema/smartmap/HazardArea/v0.1.0.json. Type https://models.geolonia.com/ns/smartmap#HazardArea; @context https://models.geolonia.com/context/smartmap/v0.jsonld.",
  "strict": true,
  "schema": {
    "type": "object",
    "properties": {
      "hazardType": {
        "type": "string",
        "enum": [
          "flood",
          "inlandFlood",
          "tsunami",
          "stormSurge",
          "houseCollapseFlow",
          "houseCollapseErosion"
        ],
        "description": "The kind of assumed hazard"
      },
      "scenario": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "plannedScale",
          "maximumAssumed",
          null
        ],
        "description": "For a flood: the rainfall the assumption is based on, the planned scale or the maximum assumed scale"
      },
      "depthFrom": {
        "type": [
          "number",
          "null"
        ],
        "description": "Lower bound of the depth band in metres (included) (minimum 0)"
      },
      "depthTo": {
        "type": [
          "number",
          "null"
        ],
        "description": "Upper bound of the depth band in metres (not included). Left out for the highest band (more than 0)"
      },
      "durationFrom": {
        "type": [
          "number",
          "null"
        ],
        "description": "Lower bound of the band of the assumed flood duration in hours (included) (minimum 0)"
      },
      "durationTo": {
        "type": [
          "number",
          "null"
        ],
        "description": "Upper bound of the band of the assumed flood duration in hours (not included). Left out for the highest band (more than 0)"
      },
      "rankLabel": {
        "type": [
          "string",
          "null"
        ],
        "description": "The band or class as the source writes it, unchanged"
      },
      "riverName": {
        "type": [
          "string",
          "null"
        ],
        "description": "The river the flood assumption is for"
      },
      "publisher": {
        "type": [
          "string",
          "null"
        ],
        "description": "The public body that published the assumption"
      },
      "dateIssued": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "description": "When the assumption was published"
      },
      "localGovernmentCode": {
        "type": [
          "string",
          "null"
        ],
        "pattern": "^[0-9]{6}$",
        "description": "Local government code (6 digits including the check digit) of the municipality whose map shows the area"
      },
      "location": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "Polygon"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                  },
                  "description": "A closed ring: at least 4 positions, the last equal to the first"
                },
                "description": "The outer ring, then any holes"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "MultiPolygon"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      },
                      "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                    },
                    "description": "A closed ring: at least 4 positions, the last equal to the first"
                  },
                  "description": "The outer ring, then any holes"
                },
                "description": "Polygons"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          }
        ],
        "description": "The area, as a polygon or multipolygon A GeoJSON geometry (Polygon, MultiPolygon)."
      }
    },
    "required": [
      "hazardType",
      "scenario",
      "depthFrom",
      "depthTo",
      "durationFrom",
      "durationTo",
      "rankLabel",
      "riverName",
      "publisher",
      "dateIssued",
      "localGovernmentCode",
      "location"
    ],
    "additionalProperties": false
  }
}
