{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "GeoParquet",
  "description": "Parquet metadata included in the geo field.",
  "type": "object",
  "required": ["version", "primary_column", "columns"],
  "properties": {
    "version": {
      "type": "string",
      "const": "1.1.0"
    },
    "primary_column": {
      "type": "string",
      "minLength": 1
    },
    "columns": {
      "type": "object",
      "minProperties": 1,
      "patternProperties": {
        ".+": {
          "type": "object",
          "required": ["encoding", "geometry_types"],
          "properties": {
            "encoding": {
              "type": "string",
              "pattern": "^(WKB|point|linestring|polygon|multipoint|multilinestring|multipolygon)$"
            },
            "geometry_types": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$"
              }
            },
            "crs": {
              "oneOf": [
                {
                  "$ref": "https://proj.org/schemas/v0.7/projjson.schema.json"
                },
                {
                  "type": "null"
                }
              ]
            },
            "edges": {
              "type": "string",
              "enum": ["planar", "spherical"]
            },
            "orientation": {
              "type": "string",
              "const": "counterclockwise"
            },
            "bbox": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "oneOf": [
                {
                  "description": "2D bbox consisting of (xmin, ymin, xmax, ymax)",
                  "minItems": 4,
                  "maxItems": 4
                },
                {
                  "description": "3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)",
                  "minItems": 6,
                  "maxItems": 6
                }
              ]
            },
            "epoch": {
              "type": "number"
            },
            "covering": {
              "type": "object",
              "required": [
                "bbox"
              ],
              "properties": {
                "bbox": {
                  "type": "object",
                  "required": ["xmin", "xmax", "ymin", "ymax"],
                  "properties": {
                    "xmin": {
                      "type": "array",
                      "items": [
                        { "type": "string", "minLength": 1 },
                        { "const": "xmin" }
                      ],
                      "minItems": 2,
                      "maxItems": 2
                    },
                    "xmax": {
                      "type": "array",
                      "items": [
                        { "type": "string", "minLength": 1 },
                        { "const": "xmax" }
                      ],
                      "minItems": 2,
                      "maxItems": 2
                    },
                    "ymin": {
                      "type": "array",
                      "items": [
                        { "type": "string", "minLength": 1 },
                        { "const": "ymin" }
                      ],
                      "minItems": 2,
                      "maxItems": 2
                    },
                    "ymax": {
                      "type": "array",
                      "items": [
                        { "type": "string", "minLength": 1 },
                        { "const": "ymax" }
                      ],
                      "minItems": 2,
                      "maxItems": 2
                    }
                  }
                }
              }
            }
          }
        }
      },
      "additionalProperties": false
    }
  }
}
