Skip to content

Conversation

@kevinkreiser
Copy link
Contributor

hi! would you be willing to support a slight refactor to marshal not just to bytes but rather to the precursor mvt spec proto objects? this is useful for grpc services which will automatically do the marshalling to bytes as part of their request handling. ive not tested this but wanted to do the PR as an illustration. let me know if its something you'd be ok supporting or not and i can write tests and clean it up if so!

// Marshal will take a set of layers and encode them into a Mapbox Vector Tile format.
// Features that have a nil geometry, for some reason, will be skipped and not included.
func Marshal(layers Layers) ([]byte, error) {
vt, err := MarshalToVectorTile(layers)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty straight forward, i just moved the guts out into another function right before marshalling to bytes. and leave the proto marshaling here for callers of this function

@paulmach
Copy link
Owner

paulmach commented Sep 6, 2025

Thank you

@paulmach paulmach merged commit 45a6519 into paulmach:master Sep 6, 2025
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