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

Uncompressed mapnik vector tiles are not supported #71

Closed
strk opened this issue Aug 14, 2014 · 7 comments
Closed

Uncompressed mapnik vector tiles are not supported #71

strk opened this issue Aug 14, 2014 · 7 comments
Assignees

Comments

@strk
Copy link

strk commented Aug 14, 2014

Passing an uncompressed PBF from a backend's getTile is not supported, see:
https://github.com/mapbox/tilelive-vector/blob/master/backend.js#L106-L112

See #70 for full discussion and mapbox/tiletype#4 for a prerequisite to fix this one

@bcamper
Copy link

bcamper commented Aug 14, 2014

Would it be feasible for tilelive-vector to check the response headers to see if the tile is compressed?

@strk
Copy link
Author

strk commented Aug 14, 2014

As tilelive-vector already invokes tiletype to check the type of a tile, I'd rather keep using that one to know if a tile is compressed or not. Right now the tiletype.type method considers the ZLIB header as a sign that the payload is a PBF, while it does not recognize an uncompressed one as a PBF.

I think the straight way would be for tiletype.type to signal compressed pbf as 'pbfz' or something like that, and use 'pbf' for uncompressed, but for backward compatibility it could be easier to keep 'pbf' for the compressed one and 'pbfu' for the uncompressed.

Note that any zlib-compressed payload would be recognized as 'pbf' even if it is not...

@jfirebaugh jfirebaugh self-assigned this Aug 14, 2014
@jfirebaugh
Copy link
Contributor

This is in the works, see #69. In fact, tilelive-vector will rely on the backend getTile to perform appropriate decompression, and only uncompressed PBFs will be recognized. (This is a breaking change and will come with a semver bump to 3.0.)

@bcamper
Copy link

bcamper commented Aug 14, 2014

Great, thanks.

@jfirebaugh
Copy link
Contributor

After some deliberation, we're taking a different tack on this, and choosing to move towards treating gzip compression as much more closely tied to the vector tile format itself, with the eventual goal of having "mapnik vector tile" mean "gzip-compressed protobuf". What that means for tilelive-vector is that it will expect to receive a gzipped protobuf from the upstream VT source (deflate support will remain for backward compatibility). It will not support receiving an uncompressed protobuf.

@bcamper
Copy link

bcamper commented Aug 19, 2014

Thanks, that works in our case, we were already serving gzipped tiles (or uncompressed), just not deflate.

@bcamper
Copy link

bcamper commented Aug 19, 2014

Also I could be mistaken but I have a vague recollection that uncompressed tiles were being served to TM2 because it wasn't sending an Accept-Encoding header.

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

3 participants