mapbox / mapbox/osmpbf-tutorial
Warn about the multiple bytes fields (writingprogram, source, osmosis_replication_*...)
还没有人认领这个 Issue。
- 主要语言
- 没有语言数据
- 星标
- 23
- 派生
- 3
- PR 合并指标
- 30 天内没有已合并 PR
描述
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 ;)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
该 issue 没有指定文件或测试。找到解释 fieldwire 和 size 的教程部分,然后记录字段编号大于 15 时会使用额外的 varint 字节,并以 writingprogram (16) 和 source (17) 为例。完成标准是读者能够清楚理解这个额外字节以及解码行为。
由索引模型根据 Issue 内容生成。
评估
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100