Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vector_layers to match tilejson-spec 3.0 #53

Open
mapsam opened this issue May 8, 2018 · 1 comment
Open

Update vector_layers to match tilejson-spec 3.0 #53

mapsam opened this issue May 8, 2018 · 1 comment

Comments

@mapsam
Copy link
Member

mapsam commented May 8, 2018

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?

cc @ericfischer @GretaCB @flippmoke

@e-n-f
Copy link
Contributor

e-n-f commented May 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants