geosot icon indicating copy to clipboard operation
geosot copied to clipboard

实现GeoSOT经纬度剖分网格编码/解码算法

Results 5 geosot issues
Sort by recently updated
recently updated
newest added

您好,请问编码实现部分有C++版本吗

I have been reading the source code you wrote recently, but I have never figured out how to decode it. I can help you.

用乘二取整法计算小数点后的二进制码时,达到指定精度后应该截断小数部分取整数。`LonLatSegment`这个类的构造方法中用Math.Round来实现。 但我发现C#的Math.Round方法做的是四舍五入而不是截断小数,导致了一些预期外的结果。 ```C# var dotSeconds = (seconds - S) * 2048; S11 = (uint)Math.Round(dotSeconds); ``` 参考了这个Java实现([repo](https://gitee.com/355tzl/geo-sot))直接将double强制转换为int,效果和Trucate是一样的。 我觉得这部分的代码可能需要修改为: ```C# var dotSeconds = (seconds - S) * 2048; S11 = (uint)Math.Truncate(dotSeconds); ```...