Function S2CellId.getEdgeNeighbors

Returns the four cells that are adjacent across the cell's four edges. Neighbors are returned in the order defined by S2Cell::GetEdge. All neighbors are guaranteed to be distinct.

void getEdgeNeighbors (
  out S2CellId[4] neighbors
) const;