/** * Returns an invalid cell id guaranteed to be larger than any valid cell id. * Useful for creating indexes. *#/ * public static S2CellId sentinel() { * return new S2CellId(MAX_UNSIGNED); // -1 * } * * /** * Return a cell given its face (range 0..5), 61-bit Hilbert curve position * within that face, and level (range 0..MAX_LEVEL). The given position will * be modified to correspond to the Hilbert curve position at the center of * the returned cell. This is a static function rather than a constructor in * order to give names to the arguments. */ public static function fromFacePosLevel($face, $pos, $level) { $s2cell = new S2CellId(($face << self::POS_BITS) + ($pos | 1)); return $s2cell->parent($level); }