Warn about the multiple bytes fields (writingprogram, source, osmosis_replication_*...)

Open
#4 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Domain
documentation

Research direction

The issue does not name a file or test. Locate the tutorial section explaining fieldwire and size, then document that field numbers above 15 use an additional varint byte, using writingprogram (16) and source (17) as examples. Done means the extra byte and decoding behavior are clear to readers.

Written by the indexing model from the issue text.

Description

Hello,

I think it could be good to warn when a field number exceeds 15, it needs more bytes to be encoded exactly like varints.

It happens for example on the writingprogram field ( = 16) which is encoded on two bytes 0x82 0x01.
MSB here is reserved to indicate the value also encoded on the next byte.
Decoding it like a varint is the way.

Also on source field ( = 17), and basically every field number greater than 15.

It personnaly took a while to understand why there was another byte between fieldwire and size and I think it'll be great to write it down to help a byte more ;)

Dominant language
No language data
Stars
23
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/osmpbf-tutorial

All issues in mapbox/osmpbf-tutorial

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.