Closed jzarzuela closed 8 years ago
@jzarzuela Great Question!
Let me explain in detail why this file is much more complex, this tile contains a LOT of information and there is a lot you can do with the vector tile! Here is a short list of the number of features in this layer:
This is all to produce this tile:
The important thing to note is that this tile may not just be used to create just one raster tile if you wanted. You can create other raster tiles from zoomed in data! This means it is actually possible to zoom into something much more detailed from this layer with out reloading in GL.
Here is a debug tool we are working on for vector tiles (that we hope to one day share with everyone), and you can see us zooming in on the data in the tile that you provided for the building layers:
You can see how much additional detail is provided for just one layer of information! So while:
16.725 bytes PNG versus 35.206 bytes PBF file. is for the zoom level 14 tile. If that tile is sufficient for all zoom layers between 14 to 18, you have effectively provided information for 4^4 + 1 tiles. So that is roughly (256 * 16.725) bytes worth of PNGs.
You also contain more information in the vector tile that is not at all used in that style. This means you can:
All of these are not possible with just the raster tile.
Thanks for the detailed awnser. It's awesome!.
Just one last question:
Although, as you mention, the same tile could be used for other zoom levels (and safe all the space it claims), as far as I know the framework asks for more tiles using the previous URL as a template in the form of: http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/{zoom}/{x}/{y}.vector.pbf?access_token={token}
So, in fact, it doesn't really safe any space... Does it?
Would it possible to force it to reuse that tile for other zoom level?
Thanks.
The savings comes from two sources:
Raster: 16 kb * 4 (67 kb) PBF: 35 kb (~2x smaller)
Check out this comparison chart I just made: https://plot.ly/~mourner/118.embed
Really helpful info! Great way for me to explaining n vector benefits to others.
@cccruzr some resources to understand overzooming:
How convert the mapbox vector tile to a png tile? Thanks.
How convert the mapbox vector tile to a png tile?
The Mapbox Static API is designed to do that: https://www.mapbox.com/static-maps. Additionally, there are many ways to convert vector tiles into other, visual representations. One of my favorites is vector tile -> svg done by https://github.com/mapbox/mvt-cruncher
Hi, I read that vector tiles would be much more space efficient than raster tiles. But comparing what your HTML or iOS demo apps are downloading it doesn't look like so.
For example:
http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/14/4823/6160.vector.pbf?access_token={token}
https://api.mapbox.com/v4/mapbox.streets/14/4823/6160.png?access_token={token}
Results in downloading 16.725 bytes PNG versus 35.206 bytes PBF file.
How is it possible?