The TileJSON specification v3.0 will be released soon - this version documents the de factor requirements for vector_layers by adapting the text from 1.3 of this specification.
A key difference is that the TileJSON specification does not require field values to be explicitly Number, String, or Boolean and suggests it should just be a string that describes the attribute. Here is what the mbtiles specification says:
fields (object): A JSON object whose keys and values are the names and types of attributes available in this layer. Each type MUST be the string "Number", "Boolean", or "String". Attributes whose type varies between features SHOULD be listed as "String".
And the tilejson-spec 3.0 proposes the following:
fields (object): A JSON object whose keys and values are the names and descriptions of attributes available in this layer. Each value (description) MUST be a string. The values MAY describe the underlying data type, such as "String", "Number", or "Boolean". Attributes whose type varies between features MAY be listed as "String".
The current mbtiles-spec will continue to be valid once 3.0 is released with this description (since they are strings), but the requirements are unnecessarily strict. In general, the mbtiles-specification is driven by encoders, so the current requirement is likely driven by the inability for computers to put together implicit descriptions other than determining the data type.
Once tilejson-spec is released, can we update the mbtiles-spec to be more relaxed and point to this description of "vector_layers" as the source of truth?
Sounds great. The existing description was based on what Mapbox Studio Classic happened to produce, which works, but is more restrictive than it needs to be.
The TileJSON specification v3.0 will be released soon - this version documents the de factor requirements for
vector_layers
by adapting the text from 1.3 of this specification.A key difference is that the TileJSON specification does not require
field
values to be explicitlyNumber
,String
, orBoolean
and suggests it should just be a string that describes the attribute. Here is what the mbtiles specification says:And the tilejson-spec 3.0 proposes the following:
The current mbtiles-spec will continue to be valid once 3.0 is released with this description (since they are strings), but the requirements are unnecessarily strict. In general, the mbtiles-specification is driven by encoders, so the current requirement is likely driven by the inability for computers to put together implicit descriptions other than determining the data type.
Once tilejson-spec is released, can we update the mbtiles-spec to be more relaxed and point to this description of "vector_layers" as the source of truth?
cc @ericfischer @GretaCB @flippmoke