AttributeData
The various types of data that can be attached to an Attribute
.
Number
Number data with flexible type.
Values can be stored as 32 or 64-bit signed integers, 32 or 64-bit floating point, date, or date-time. Valid dates are approximately ±262,000 years from the common era. Date-time values are written with microsecond accuracy, and times are always in UTC.
Fields
type
"Number"
colormap
:NumberColormap
or null-
Optional colormap. If absent then the importing application should invent one.
Make sure the colormap uses the same number type as
values
. values
:Array
- Array with
Number
type storing the attribute values.
Vector
2D or 3D vector data.
Fields
type
"Vector"
values
:Array
- Array with
Vector
type storing the attribute values.
Text
Text data.
Fields
type
"Text"
values
:Array
- Array with
Text
type storing the attribute values.
Category
Category data.
A name is required for each category, a color is optional, and other values can be attached as sub-attributes.
Fields
type
"Category"
attributes
: array ofAttribute
-
Additional attributes that use the same indices.
This could be used to store the density of rock types in a lithology attribute for example. The location field of these attributes must be
Categories
[crate::Location::Categories]. They must have the same length asnames
. gradient
:Array
or null-
Optional array with
Gradient
type storing category colors.If present, must be the same length as
names
. If absent then the importing application should invent colors. names
:Array
- Array with
Name
type storing category names. values
:Array
-
Array with
Index
type storing the category indices.Values are indices into the
names
array,colors
array, and any sub-attributes, and must be within range for them.
Boolean
Boolean or filter data.
Fields
type
"Boolean"
values
:Array
-
Array with
Boolean
type storing the attribute values.These values may be true, false, or null. Applications that don't support three-valued logic may treat null as false.
Color
Color data.
Fields
type
"Color"
values
:Array
-
Array with
Color
type storing the attribute values.Null values may be replaced by the element color, or a default color as the application prefers.
MappedTexture
A texture applied with UV mapping.
Typically applied to surface vertices. Applications may ignore other locations.
Fields
type
"MappedTexture"
image
:Array
- Array with
Image
type storing the texture image. texcoords
:Array
-
Array with
Texcoord
type storing the UV texture coordinates.Each item is a normalized (U, V) pair. For values outside [0, 1] the texture wraps.
ProjectedTexture
A texture defined as a rectangle in space projected along its normal.
Behavior of the texture outside the projected rectangle is not defined. The texture might repeat, clip the element, or itself be clipped to reveal the flat color of the element.
The attribute location must be Projected
.
Fields
type
"ProjectedTexture"
height
: number- Height of the image projection in space.
image
:Array
- Array with
Image
type storing the texture image. orient
:Orient2
- Orientation of the image.
width
: number- Width of the image projection in space.
Schema
{
"oneOf": [
{
"type": "object",
"required": [
"type",
"values"
],
"properties": {
"colormap": {
"anyOf": [
{
"$ref": "#/definitions/NumberColormap"
},
{
"type": "null"
}
]
},
"type": {
"type": "string",
"enum": [
"Number"
]
},
"values": {
"$ref": "#/definitions/Array"
}
}
},
{
"type": "object",
"required": [
"type",
"values"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Vector"
]
},
"values": {
"$ref": "#/definitions/Array"
}
}
},
{
"type": "object",
"required": [
"type",
"values"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Text"
]
},
"values": {
"$ref": "#/definitions/Array"
}
}
},
{
"type": "object",
"required": [
"names",
"type",
"values"
],
"properties": {
"attributes": {
"type": "array",
"items": {
"$ref": "#/definitions/Attribute"
}
},
"gradient": {
"anyOf": [
{
"$ref": "#/definitions/Array"
},
{
"type": "null"
}
]
},
"names": {
"$ref": "#/definitions/Array"
},
"type": {
"type": "string",
"enum": [
"Category"
]
},
"values": {
"$ref": "#/definitions/Array"
}
}
},
{
"type": "object",
"required": [
"type",
"values"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Boolean"
]
},
"values": {
"$ref": "#/definitions/Array"
}
}
},
{
"type": "object",
"required": [
"type",
"values"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Color"
]
},
"values": {
"$ref": "#/definitions/Array"
}
}
},
{
"type": "object",
"required": [
"image",
"texcoords",
"type"
],
"properties": {
"image": {
"$ref": "#/definitions/Array"
},
"texcoords": {
"$ref": "#/definitions/Array"
},
"type": {
"type": "string",
"enum": [
"MappedTexture"
]
}
}
},
{
"type": "object",
"required": [
"height",
"image",
"orient",
"type",
"width"
],
"properties": {
"height": {
"type": "number",
"format": "double"
},
"image": {
"$ref": "#/definitions/Array"
},
"orient": {
"$ref": "#/definitions/Orient2"
},
"type": {
"type": "string",
"enum": [
"ProjectedTexture"
]
},
"width": {
"type": "number",
"format": "double"
}
}
}
]
}