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

How do I encode a decoded mvt? #130

Open
Learningbug04 opened this issue Feb 27, 2023 · 3 comments
Open

How do I encode a decoded mvt? #130

Learningbug04 opened this issue Feb 27, 2023 · 3 comments

Comments

@Learningbug04
Copy link

Learningbug04 commented Feb 27, 2023

I want to modify a part of the properties on the decoded tile and re-encode it.
for example
decoded_tile = mapbox_vector_tile.decode(b'\x1aJ\n\x05water\x12\x1a\x08\x01\x12\x06\x00\x00\x01\x01\x02\x02\x18\x03"\x0c\t\x00\x80@\x1a\x00\x01\x02\x00\x00\x02\x0f\x1a\x03foo\x1a\x03uid\x1a\x03cat"\x05\n\x03bar"\x02 {"\x06\n\x04flew(\x80 x\x02\x1aY\n\x03air\x12\x1c\x08\x01\x12\x08\x00\x00\x01\x01\x02\x02\x03\x03\x18\x03"\x0c\t\x00\x80@\x1a\x00\x01\x02\x00\x00\x02\x0f\x1a\x03foo\x1a\x03uid\x1a\x05balls\x1a\x03cat"\x05\n\x03bar"\x03 \xd2\t"\x05\n\x03foo"\x06\n\x04flew(\x80 x\x02') mapbox_vector_tile.encode(decoded_tile)

But I can't.
Is there any way you can do it?

@fallaciousreasoning
Copy link

👍 seems like a bit of an oversight that you can't do mvt.encode(mvt.decode(bytes))

@rmarianski
Copy link
Member

the README has some pointers on encoding/decoding. However, if you're looking to make direct alterations, consider interacting with the protobufs directly.

@nvkelso
Copy link
Member

nvkelso commented Jun 16, 2024

Suggest adding a discussion topic over in https://github.com/maplibre/maplibre-tile-spec as next iteration of format is being worked on there...

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

No branches or pull requests

4 participants