Skip to content
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

BD 算法偏移系数有误 #43

Open
Artoria2e5 opened this issue Dec 24, 2016 · 7 comments
Open

BD 算法偏移系数有误 #43

Artoria2e5 opened this issue Dec 24, 2016 · 7 comments

Comments

@Artoria2e5
Copy link
Contributor

Artoria2e5 commented Dec 24, 2016

BD 的原始泄出实现中有一个 x_pi 变量,指的是 3000 / 180 * Math.PI,eviltransform 抄过来变成了 Math.PI

想要测试的话尽管上 http://lbsyun.baidu.com/index.php?title=webapi/guide/changeposition 去比。

@googollee
Copy link
Owner

BD应该是别人贡献的,我开始的时候并没有打算包含BD的算法实现。毕竟百度的东西,没人支持也就没人用了对吧。

@googollee
Copy link
Owner

我确认一下这个

@adclose
Copy link
Contributor

adclose commented Dec 19, 2017

I saw this issue in the python implementation. Are there some good test Points I can be used for testing wgs to bd? I get too large of errors in the current test data I just want to make sure it's ok

@Artoria2e5
Copy link
Contributor Author

Artoria2e5 commented Dec 20, 2017

Nah just use the constant in https://github.com/Artoria2e5/PRCoords/blob/05d1c12/js/PRCoords.js#L145-L158. It's really just pi times 3000: they missed the 3000. Play around in https://artoria2e5.github.io/PRCoords/demo if you want to.

@Artoria2e5
Copy link
Contributor Author

And since you are doing a Matlab implementation, I strongly recommend that you read caijun's R implementation at https://github.com/caijun/geoChina. Solid work by, well, a math-y R programmer I guess.

w1ndy added a commit to w1ndy/eviltransform that referenced this issue Jan 2, 2018
@w1ndy
Copy link
Contributor

w1ndy commented Jan 2, 2018

Changing pi to X_PI did reduce the error rate (See testcases at https://gist.github.com/w1ndy/5236bca0654f472c8cffa038406441ed). I've fixed the python implementation and released a new package.

@w1ndy
Copy link
Contributor

w1ndy commented Jan 2, 2018

Before:

Encryption: Lat RMSE 0.000330, Lng RMSE 0.000091; Decryption: Lat RMSE 0.000330, Lng RMSE 0.000091

After:

Encryption: Lat RMSE 0.000000, Lng RMSE 0.000000; Decryption: Lat RMSE 0.000001, Lng RMSE 0.000000

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

No branches or pull requests

4 participants