mapbox/vtzero

layer_builder.rollback() ?

springmeyer opened this issue · 3 comments

I have a usecase where I create a layer_builder and then add features to it. In the event that no features are added (due to filtering) I'd like to avoid adding this layer to the tile. But by the time I know that no features have been added, the layer has already been added to the tile and queued up to be serialized. How best can this be best solved? Could the code here check for whether features have been added and if so skip calling ->build()?

/cc @joto

joto commented

This is now implemented.

@joto - could you please link to a commit, the lines of code for the new API, or docs?

joto commented

I'll write up some docs as soon as possible.