{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://geojason.com/data/geojson.strict.schema.json",
  "title": "GeoJSON (RFC 7946), strict variant",
  "description": "The canonical schema with every object closed to unknown members and every non-optional property required. Shaped for constrained decoding, which is stricter than RFC 7946 allows.",
  "$comment": "Generated by scripts/generate-schema-variants.mjs. Do not edit by hand. This variant refuses foreign members, which RFC 7946 section 6.1 permits.",
  "stricterThanSpec": [
    "A position may carry at most three elements. RFC 7946 says implementations SHOULD NOT go beyond three, which is advice rather than a rule, so this schema refuses a document the specification does not call invalid."
  ],
  "$ref": "#/$defs/GeoJSON",
  "$defs": {
    "GeoJSON": {
      "oneOf": [
        {
          "$ref": "#/$defs/Geometry"
        },
        {
          "$ref": "#/$defs/Feature"
        },
        {
          "$ref": "#/$defs/FeatureCollection"
        }
      ]
    },
    "position": {
      "description": "Longitude, latitude, and an optional height in metres above the WGS 84 ellipsoid.",
      "$comment": "maxItems is the one place this schema is deliberately stricter than RFC 7946. The specification says implementations SHOULD NOT extend positions beyond three elements and that parsers MAY ignore extra ones, so a fourth element is discouraged rather than invalid. It is refused here because a fourth element is usually a timestamp or a measure that nothing downstream will read correctly. Remove maxItems to match the specification exactly.",
      "type": "array",
      "items": {
        "type": "number"
      },
      "minItems": 2,
      "maxItems": 3
    },
    "bbox": {
      "description": "Two positions flattened: all axes of the southwesterly point, then all axes of the northeasterly point.",
      "type": "array",
      "items": {
        "type": "number"
      },
      "oneOf": [
        {
          "minItems": 4,
          "maxItems": 4
        },
        {
          "minItems": 6,
          "maxItems": 6
        }
      ]
    },
    "linearRing": {
      "description": "A closed LineString with four or more positions. Closure itself cannot be expressed in JSON Schema.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/position"
      },
      "minItems": 4
    },
    "Point": {
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "properties": {
        "type": {
          "const": "Point"
        },
        "coordinates": {
          "$ref": "#/$defs/position"
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "MultiPoint": {
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "properties": {
        "type": {
          "const": "MultiPoint"
        },
        "coordinates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/position"
          }
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "LineString": {
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "properties": {
        "type": {
          "const": "LineString"
        },
        "coordinates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/position"
          },
          "minItems": 2
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "MultiLineString": {
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "properties": {
        "type": {
          "const": "MultiLineString"
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/position"
            },
            "minItems": 2
          }
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "Polygon": {
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "properties": {
        "type": {
          "const": "Polygon"
        },
        "coordinates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/linearRing"
          }
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "MultiPolygon": {
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "properties": {
        "type": {
          "const": "MultiPolygon"
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/linearRing"
            }
          }
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "GeometryCollection": {
      "$comment": "RFC 7946 says implementations SHOULD avoid nesting these. Discouraged is not forbidden, so the recursion stays.",
      "type": "object",
      "required": [
        "type",
        "geometries"
      ],
      "properties": {
        "type": {
          "const": "GeometryCollection"
        },
        "geometries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Geometry"
          }
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "Geometry": {
      "oneOf": [
        {
          "$ref": "#/$defs/Point"
        },
        {
          "$ref": "#/$defs/MultiPoint"
        },
        {
          "$ref": "#/$defs/LineString"
        },
        {
          "$ref": "#/$defs/MultiLineString"
        },
        {
          "$ref": "#/$defs/Polygon"
        },
        {
          "$ref": "#/$defs/MultiPolygon"
        },
        {
          "$ref": "#/$defs/GeometryCollection"
        }
      ]
    },
    "Feature": {
      "type": "object",
      "required": [
        "type",
        "geometry",
        "properties"
      ],
      "properties": {
        "type": {
          "const": "Feature"
        },
        "geometry": {
          "oneOf": [
            {
              "$ref": "#/$defs/Geometry"
            },
            {
              "type": "null"
            }
          ]
        },
        "properties": {
          "oneOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "id": {
          "type": [
            "string",
            "number"
          ]
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    },
    "FeatureCollection": {
      "type": "object",
      "required": [
        "type",
        "features"
      ],
      "properties": {
        "type": {
          "const": "FeatureCollection"
        },
        "features": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Feature"
          }
        },
        "bbox": {
          "$ref": "#/$defs/bbox"
        }
      },
      "additionalProperties": false
    }
  }
}
