S2RegionCoverer not respecting min/max cell level?

302 Views Asked by At

When using Google's S2 geometry library to draw S2 cells on a google map widget, I'm getting cells that are outside my specified (constant) range.

S2RegionCoverer cov = new S2RegionCoverer();
cov.setMaxLevel(14);
cov.setMinLevel(14);
S2CellUnion cells = cov.getCovering(region_rect);

The resulting cells have levels 11-14, where am I going wrong?

1

There are 1 best solutions below

0
On

Apparently this is by design, and using this function instead, passing any point in the area as well as an empty ArrayList does the trick.

cov.getSimpleCovering(region_rect, bl.toPoint(),14,cells);