S2Cell.contains

Returns true if the cell contains the given point "p". Note that unlike S2Loop/S2Polygon, S2Cells are considered to be closed sets. This means that points along an S2Cell edge (or at a vertex) belong to the adjacent cell(s) as well.

If instead you want every point to be contained by exactly one S2Cell, you will need to convert the S2Cells to S2Loops (which implement point containment this way).

The point "p" does not need to be normalized.

  1. bool contains(S2Cell cell)
  2. bool contains(S2Point p)
    class S2Cell
    override const
    bool
    contains
    ()

Meta