Closed systemed closed 5 years ago
Im using vector tiles stored in mbtiles files in mobile applications, with format set to pbf, and compressing the tiles with deflate(using zlib). I don't use a json metadata field.
This is also done by Mapbox Studio when uploading custom sources. I don't have a lot of info there, but you could check the source.
Yep. That's pretty much what I did - looked at mapbox-upload-validate and tiletype to figure out what Tilemaker should do. But it'd be good to have it canonicalised here.
Tippecanoe has another implementation of how to write the format. It seems like the json
ought to be part of the spec unless there are other clients that don't require it.
It's somewhat misleading to use pbf
to mean zipped pbf
. protobuf doesn't in itself have any support for DEFLATE (http://stackoverflow.com/a/7181908/1908650). format
should contain something that indicates that the content is zipped PBF, rather than plain PBF.
NB. Not trying to be pedantic -- I have spent a lot of time on a wild goose chase due to this issue. I know that vector MBTiles contain zipped PBF, but it's still not clear to me whether it's legitimate for a vector tileserver to output either PBF or zipped PBF, or whether it has to be one of the two. If anyone knows, I'd be grateful for the clarification.
NB. Not trying to be pedantic -- I have spent a lot of time on a wild goose chase due to this issue. I know that vector MBTiles contain zipped PBF, but it's still not clear to me whether it's legitimate for a vector tileserver to output either PBF or zipped PBF, or whether it has to be one of the two. If anyone knows, I'd be grateful for the clarification.
It can output either. It's common to only serve with a compressed HTTP Content-Encoding
. Some implementations (notably Mapbox's) violate the HTTP spec by sending compressed data when identity is requested.
Ihope this issue will fixed soon (in #46 = version 2.0?)! In a first attempt to implement an MVT reader it took us literally days(!) of debugging, no realizing that PBF's are stored as zipped files in mbtiles. If services (notably Mapbox's) really violate the HTTP spec. this should be a separate issue.
Ran into this old issue, which is resolved by https://github.com/mapbox/mbtiles-spec/blob/master/1.3/spec.md#content. Note: above there is mention of deflate compression, but actually vector tiles are expected to be encoded with gzip coding rather than pure deflate coding (see https://github.com/ebiggers/libdeflate#deflate-vs-zlib-vs-gzip for the differences).
Vector tiles can also be stored in the MBTiles format.
It would be good if the spec explained how. From what I can tell:
format
metadata should bepbf
.The Mapbox.com implementation also appears to require a
json
metadata field containing various JSON-encoded values, but I'm presuming this is implementation-specific rather than part of the MBTiles spec.