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
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