S2CellUnion.expand

Expands the cell union by adding a buffer of cells at "expand_level" around the union boundary.

For each cell "c" in the union, we add all neighboring cells at level "expand_level" that are adjacent to "c". Note that there can be many such cells if "c" is large compared to "expand_level". If "c" is smaller than "expand_level", we first add the parent of "c" at "expand_level" and then add all the neighbors of that cell.

Note that the size of the output is exponential in "expand_level". For example, if expand_level == 20 and the input has a cell at level 10, there will be on the order of 4000 adjacent cells in the output. For most applications the Expand(min_radius, max_level_diff) method below is easier to use.

  1. void expand(int expand_level)
    class S2CellUnion
    void
    expand
  2. void expand(S1Angle min_radius, int max_level_diff)

Meta