google / google/s2-geometry-library-java

Infinite loop in coverer builder

未关闭
#55 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
587
派生
231
PR 合并指标
30 天内没有已合并 PR

描述

```
S2RegionCoverer coverer = S2RegionCoverer.builder()
.setMinLevel(20)
.setMaxLevel(10)
.build();
S2Cap cap = S2Cap.fromAxisAngle(new S2Point(1, 0, 0), S1Angle.degrees(5));
S2CellUnion covering = coverer.getCovering(cap); // OutOfMemoryError
```

The coverer keeps trying to refine cells to reach minLevel(20), but maxLevel(10) prevents going past level 10, so it never satisfies the min level constraint and spirals until the JVM runs out of heap. Could be prevented by checking that min < max

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。