Skip to content

fix issue #238 #240

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

Merged
merged 1 commit into from
Mar 4, 2025
Merged

fix issue #238 #240

merged 1 commit into from
Mar 4, 2025

Conversation

WwhdsOne
Copy link
Contributor

@WwhdsOne WwhdsOne commented Mar 2, 2025

在encode0方法中的每次循环,对于经度(对应 box[0][0] 和 box[0][1])和纬度(对应 box[1][0] 和 box[1][1])这两个维度,都是按照相同的逻辑去不断地二等分范围。
每一次循环迭代,都是通过计算当前维度范围的中间值 mid,然后根据坐标值与 mid 的比较结果来更新该维度范围的边界(也就是 box 中对应维度的两个值)。这种二等分的更新方式是完全对称的操作,在经过相同次数的迭代(由 bitSize 决定迭代次数)后,经度和纬度这两个维度的范围缩小比例是一样的,所以最终它们的范围差值(也就是 box[0][1] - box[0][0] 和 box[1][1] - box[1][0])会相同,即height和width相同。
由于后续内容对于height和width的使用是对称的,尽管逻辑与正常的经纬度计算逻辑不一致,但是并不影响最终结果。

@HDT3213 HDT3213 merged commit 341c16d into HDT3213:master Mar 4, 2025
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants