mapbox / mapnik-vector-tile

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

Datasource using pbf.hpp #114

Closed danpat closed 9 years ago

danpat commented 9 years ago

This pull request goes partway towards #92.

It's an implementation of a read-only mapnik::datasource that is faster, and uses less memory than the existing vector_tile_datasource. The main gain is though avoiding creation of Google Protobuf proxy objects, this datasource mostly reads the .pbf byte stream in-place, saving a bunch of memory.

It should be used in places where you need to plug in a mapnik::datasource to read from a binary encoded .pbf buffer.

It's single-use, many of the pointers cannot be re-wound.

springmeyer commented 9 years ago

Confirmed that this works great in node-mapnik with no futher changes (https://github.com/mapnik/node-mapnik/commit/984718834ae5bff0c52206675181e84baa6f2066), so this is ready to merge.

The plan will be to include this in the v0.8.1 tag and allow consumers to start opting-in where appropriate. The tile_datasource that operates on vector_tile::Tile is still useful and will stick around in parallel for now.