Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Marshalling to Proto Objects #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinkreiser
Copy link

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
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

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.

1 participant