The Mapbox vector tile specification provides structure for including data values as properties associated with a feature, but no mechanism for interpreting the meaning or intended use. As such, GIBS has developed a specification for defining each property contained within MVTs in its vector products. Each vector product has an associated JSON vector metadata file which provides the following information:
- A unique identifier for the property, as found in the MVT data itself
- Descriptive information such as a title, description, and the function of the property (e.g. identification vs styling)
- The data type and optional units for the property
- Valid values for the property
- Additional flags for improved UI experience
The current vector metadata JSON schema may be found here.
The following table outlines the fields in the GIBS vector metadata specification.
|Identifier||The unique identifier of the MVT property.||String|
|Title||A human readable title for the property.||String|
|Description||A human readable description for the property.||String|
|Units||The units value to be applied to the actual value of this property.||String|
|DataType||The data type of this property. Possible values include int, float, string, or datetime.||Enumeration|
|ValueList||A listing of the possible valid values for a 'string' property type, if the property has a controlled list.||Array|
Only one may be used
|ValueRanges||A listing of mutually exclusive min and max value pairs representing ranges of valid values for the 'Integer', 'float', and 'datetime' property types.||Array of Objects|
|ValueMap||A map of the possible valid values for 'string' or 'int' property types, and their associated description. This facilitates a key-value lookup table allowing for a simplified property value (i.e. the ‘key’).||Object|
The property’s intended function as a part of the visualization product. Possible values include:
|IsOptional||Indicates whether the property is optional.||Boolean|
|IsLabel||Indicates whether the property should be used to label the point in a user interface.||Boolean|
All vector metadata file are validated against the following "business logic" rules that extend beyond the basic individual property constraints.
- A single, non-optional, property will be identified as the "label".
- A single, non-optional, property will have the "Identify" function, which acts as the primary key for properties.
- Properties are uniquely identified by their Identifier field.
- Items in the ValueList are unique.
- ValueRange is only supported for properties with a DataType of "int", "float", or "datetime."
- ValueRange is only supported for properties with a DataType of "int" or "string.
A vector metadata file is a list of content blocks defining each property. The following snippet shows an example of a single property's definition within the vector metadata file.
The following block provides a full example of a vector metadata file.