{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"title": "Voxel Information",
	"description": "Details about the voxels contained in the file",
	"type": "object",
	"oneOf": [
		{
			"properties": {
				"shape_thresholds": {
					"$ref": "#/definitions/shape_thresholds"
				},
				"size": {
					"description": "Size of voxels in file coordinate system.",
					"oneOf": [
						{
							"$ref": "#/definitions/voxel_size"
						},
						{
							"$ref": "#/definitions/voxel_size_cubic"
						}
					]
				},
				"voxel_origin": {
					"$ref": "#/definitions/voxel_origin_enum"
				},
				"voxel_type": {
					"$ref": "#/definitions/voxel_type"
				}
			},
			"additionalProperties": false,
			"required": [
				"size",
				"voxel_origin",
				"voxel_type"
			]
		},
		{
			"properties": {
				"reference_point": {
					"items": {
						"type": "number",
						"minimum": -180,
						"maximum": 180
					},
					"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",
					"minItems": 2,
					"maxItems": 2
				},
				"shape_thresholds": {
					"$ref": "#/definitions/shape_thresholds"
				},
				"size": {
					"$ref": "#/definitions/voxel_size",
					"description": "Size of voxels in file coordinate system."
				},
				"size_llcs": {
					"$ref": "#/definitions/voxel_size",
					"description": "Size of voxels in a locally levelled cartesian coordinate system (xyz). This is only used for voxels based on a map projection."
				},
				"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"
						}
					]
				},
				"voxel_type": {
					"$ref": "#/definitions/voxel_type"
				}
			},
			"additionalProperties": false,
			"required": [
				"reference_point",
				"size_llcs",
				"size",
				"voxel_origin",
				"voxel_type"
			]
		}
	],
	"definitions": {
		"edge_length": {
			"description": "Length of voxel edge [m].",
			"exclusiveMinimum": true,
			"type": "number",
			"minimum": 0
		},
		"shape_thresholds": {
			"description": "Thresholds used to compute the voxel's shape_id value.",
			"required": [
				"plane",
				"line"
			],
			"type": "object",
			"properties": {
				"line": {
					"description": "If the biggest eigenvalue is bigger than the median eigenvalue * line_threshold, the voxel is considered a line.",
					"exclusiveMinimum": true,
					"type": "number",
					"minimum": 1
				},
				"plane": {
					"description": "If the smallest eigenvalue is smaller than the median eigenvalue * plane_threshold, the voxel is considered a plane.",
					"maximum": 1,
					"minimum": 0,
					"type": "number",
					"exclusiveMinimum": true,
					"exclusiveMaximum": true
				}
			}
		},
		"voxel_size": {
			"items": {
				"$ref": "#/definitions/edge_length"
			},
			"description": "Size of voxels.",
			"type": "array",
			"minItems": 3,
			"maxItems": 3
		},
		"voxel_size_cubic": {
			"$ref": "#/definitions/edge_length",
			"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"
		},
		"voxel_origin_point": {
			"description": "Origin point for all voxel indices in voxel CRS.",
			"items": {
				"type": "number"
			},
			"type": "array",
			"minItems": 3,
			"maxItems": 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"
		}
	}
}