mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Refactor `mapnik::vector_tile_impl::backend_pbf` for lower memory encoding #151

Closed springmeyer closed 8 years ago

springmeyer commented 9 years ago

Currently a vector_tile::Tile needs to be passed to mapnik::vector_tile_impl::backend_pbf and then the calling application is expected to call tile.SerializeToString() to get the encoded string for the entire tiles layers.

When encoding tiles with lots of layers this means that the vector_tile::Tile is going to grow in size during rendering to hold all the layers and this can use a significant amount of memory.

I have a hunch that a faster (or at least lower memory approach) would be to serialize per layer. So the API could change so that:

Another advantage of this is that it removes the need for the google protobuf structures in the public API and this would help further reduce the google dependency in our quest to completely remove it in favor of https://github.com/mapbox/protozero (refs #152)

springmeyer commented 8 years ago

done in #182 thanks to a huge push by @flippmoke!