{
	"description": "Details about the voxels contained in the file",
	"type": "object",
	"$schema": "http://json-schema.org/draft-04/schema#",
	"title": "Voxel Information",
	"oneOf": [
		{
			"required": [
				"size",
				"voxel_origin",
				"voxel_type"
			],
			"additionalProperties": false,
			"properties": {
				"shape_thresholds": {
					"$ref": "#/definitions/shape_thresholds"
				},
				"voxel_type": {
					"$ref": "#/definitions/voxel_type"
				},
				"voxel_origin": {
					"$ref": "#/definitions/voxel_origin_enum"
				},
				"size": {
					"description": "Size of voxels in file coordinate system.",
					"oneOf": [
						{
							"$ref": "#/definitions/voxel_size"
						},
						{
							"$ref": "#/definitions/voxel_size_cubic"
						}
					]
				}
			}
		},
		{
			"required": [
				"reference_point",
				"size_llcs",
				"size",
				"voxel_origin",
				"voxel_type"
			],
			"additionalProperties": false,
			"properties": {
				"voxel_origin": {
					"oneOf": [
						{
							"$ref": "#/definitions/voxel_origin_enum"
						},
						{
							"description": "The base point of the voxel grid. Used together with <tt>voxel_size</tt> and <tt>voxel_index</tt> to compute actual point coordinates.",
							"$ref": "#/definitions/voxel_origin_point"
						}
					]
				},
				"reference_point": {
					"description": "Point in WGS84 geodetic decimal degree (EPSG:4326) that was used to compute the projection distortion parameters. The coefficient order is latitude, longitude. Only voxels with corresponding geo_tag, voxel_size and reference_point can be reliably processed together. This entry is available for voxel files in projected CRS only.",
					"type": "array",
					"maxItems": 2,
					"items": {
						"type": "number",
						"maximum": 180,
						"minimum": -180
					},
					"minItems": 2
				},
				"size": {
					"description": "Size of voxels in file coordinate system.",
					"$ref": "#/definitions/voxel_size"
				},
				"shape_thresholds": {
					"$ref": "#/definitions/shape_thresholds"
				},
				"size_llcs": {
					"description": "Size of voxels in a locally levelled cartesian coordinate system (xyz). This is only used for voxels based on a map projection.",
					"$ref": "#/definitions/voxel_size"
				},
				"voxel_type": {
					"$ref": "#/definitions/voxel_type"
				}
			}
		}
	],
	"definitions": {
		"edge_length": {
			"description": "Length of voxel edge [m].",
			"exclusiveMinimum": true,
			"minimum": 0,
			"type": "number"
		},
		"voxel_origin_enum": {
			"description": "Defines whether the voxel's center or a corner is placed on CRS origin <tt>(0/0/0)</tt>.",
			"enum": [
				"center",
				"corner"
			],
			"default": "corner"
		},
		"shape_thresholds": {
			"description": "Thresholds used to compute the voxel's shape_id value.",
			"required": [
				"plane",
				"line"
			],
			"properties": {
				"line": {
					"description": "If the biggest eigenvalue is bigger than the median eigenvalue * line_threshold, the voxel is considered a line.",
					"exclusiveMinimum": true,
					"minimum": 1,
					"type": "number"
				},
				"plane": {
					"description": "If the smallest eigenvalue is smaller than the median eigenvalue * plane_threshold, the voxel is considered a plane.",
					"type": "number",
					"maximum": 1,
					"exclusiveMinimum": true,
					"minimum": 0,
					"exclusiveMaximum": true
				}
			},
			"type": "object"
		},
		"voxel_origin_point": {
			"description": "Origin point for all voxel indices in voxel CRS.",
			"type": "array",
			"maxItems": 3,
			"items": {
				"type": "number"
			},
			"minItems": 3
		},
		"voxel_type": {
			"description": "Whether a point in a voxel represents its center or its centroid. If type is <tt>index</tt> there is no point but only an integer voxel index.",
			"enum": [
				"center",
				"centroid",
				"index"
			],
			"default": "centroid"
		},
		"voxel_size": {
			"description": "Size of voxels.",
			"type": "array",
			"maxItems": 3,
			"items": {
				"$ref": "#/definitions/edge_length"
			},
			"minItems": 3
		},
		"voxel_size_cubic": {
			"type": "number",
			"$ref": "#/definitions/edge_length"
		}
	}
}