Decoding protobuf message from mapbox API, using ProtoBuf.jl


I’m new to the world of protocol buffers, looking for some guidance here.

I have a fairly simple use case which is to decode protobuf messages from the mapbox API into GeoJSON format.

How would I approach this problem? Would I need to define a custom Julia struct according to this mapbox pbf specification? Or is there a simpler, more generic way of decoding the protobuf message into a Dict of some sort.

Essentially I would like to replicate what this python library is doing!

Thanks in advance…

The general idea for handling protobuf formats are:

  1. Generate code from *.proto files using the protoc compiler with a suitable plugin for your language of choice.
  2. Call the generated code to decode or encode protobuf messages.
  3. (Optional) Convert to and from more user friendly data structures than are involved in step 2.

The Julia ProtoBuf package helps you with the first two steps. Follow the links from the README for documentation of respective step.