mapbox / mapbox/osmpbf-tutorial

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

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
23
Forks
3
PR merge metrics
No merged PRs in 30d

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

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.