{
	"$id": "https://mapliberator.com/spec/1.0-draft/schemas/areas.schema.json",
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"type": "object",
	"properties": {
		"type": {
			"type": "string",
			"const": "FeatureCollection"
		},
		"features": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"type": {
						"type": "string",
						"const": "Feature"
					},
					"id": {
						"type": "string",
						"pattern": "^area\\/[0-9]{6,}$",
						"description": "Archive-local ID: \"area/<sequence>\""
					},
					"geometry": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"type": {
										"type": "string",
										"const": "Polygon"
									},
									"coordinates": {
										"minItems": 1,
										"type": "array",
										"items": {
											"minItems": 4,
											"type": "array",
											"items": {
												"minItems": 2,
												"maxItems": 3,
												"type": "array",
												"items": {
													"type": "number"
												},
												"description": "[longitude, latitude, elevationMeters?] in WGS84 (RFC 7946 order)"
											}
										}
									}
								},
								"required": [
									"type",
									"coordinates"
								],
								"additionalProperties": {}
							},
							{
								"type": "object",
								"properties": {
									"type": {
										"type": "string",
										"const": "MultiPolygon"
									},
									"coordinates": {
										"minItems": 1,
										"type": "array",
										"items": {
											"minItems": 1,
											"type": "array",
											"items": {
												"minItems": 4,
												"type": "array",
												"items": {
													"minItems": 2,
													"maxItems": 3,
													"type": "array",
													"items": {
														"type": "number"
													},
													"description": "[longitude, latitude, elevationMeters?] in WGS84 (RFC 7946 order)"
												}
											}
										}
									}
								},
								"required": [
									"type",
									"coordinates"
								],
								"additionalProperties": {}
							}
						]
					},
					"properties": {
						"type": "object",
						"properties": {
							"name": {
								"type": "string"
							},
							"description": {
								"type": [
									"string",
									"null"
								]
							},
							"createdAt": {
								"anyOf": [
									{
										"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$",
										"description": "RFC 3339 timestamp, UTC"
									},
									{
										"type": "null"
									}
								]
							},
							"updatedAt": {
								"anyOf": [
									{
										"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$",
										"description": "RFC 3339 timestamp, UTC"
									},
									{
										"type": "null"
									}
								]
							},
							"visibility": {
								"anyOf": [
									{
										"type": "string",
										"enum": [
											"private",
											"unlisted",
											"public"
										]
									},
									{
										"type": "null"
									}
								]
							},
							"tags": {
								"type": "array",
								"items": {
									"type": "string"
								}
							},
							"source": {
								"type": "object",
								"properties": {
									"platform": {
										"type": "string",
										"minLength": 1
									},
									"id": {
										"type": "string"
									},
									"url": {
										"type": [
											"string",
											"null"
										]
									},
									"raw": {
										"description": "Scrubbed source representation; only when requested"
									}
								},
								"required": [
									"platform",
									"id"
								],
								"additionalProperties": {}
							},
							"areaSquareMeters": {
								"anyOf": [
									{
										"type": "number",
										"minimum": 0
									},
									{
										"type": "null"
									}
								]
							}
						},
						"required": [
							"name",
							"source"
						],
						"additionalProperties": {}
					}
				},
				"required": [
					"type",
					"id",
					"geometry",
					"properties"
				],
				"additionalProperties": {}
			}
		}
	},
	"required": [
		"type",
		"features"
	],
	"additionalProperties": {},
	"description": "areas/areas.geojson"
}
