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

Fix loading tiles that are not compressed #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jpilet
Copy link
Contributor

@jpilet jpilet commented Jul 10, 2019

No description provided.

@michogar
Copy link
Collaborator

Hi, @jpilet thanks for the PR, in which cases have you found the tiles are uncompressed?

@jpilet
Copy link
Contributor Author

jpilet commented Jul 12, 2019

I think some small ocean tiles are smaller uncompressed than compressed. I used tilelive copy to assemble multiple mbtiles files and I got exceptions in tile decoding.
In "tileinfo" code, uncompression is done optionally: first by checking the headers, then by decompressing only if required. See
https://github.com/mapbox/mapnik-vector-tile/blob/master/examples/c%2B%2B/tileinfo.cpp#L64
and
https://github.com/mapbox/mapnik-vector-tile/blob/master/src/vector_tile_compression.hpp#L18.

So the proper way of doing here would be the same: first check the header, then call inflate only if needed. I was short on time so I simply caught the exception thrown by inflate.

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

Successfully merging this pull request may close these issues.

2 participants