A theoretical analysis is presented of a nematic liquid crystal confined between substrates patterned with squares that promote vertical and planar alignment. Two approaches are used to elucidate the behavior across a wide range of length scales: Monte Carlo simulation of hard particles and Frank-Oseen continuum theory. Both approaches predict bistable degenerate azimuthal alignment in the bulk along the edges of the squares; the continuum calculation additionally reveals the possibility of an anchoring transition to diagonal alignment if the polar anchoring energy associated with the pattern is sufficiently weak. Unlike the striped systems previously analyzed, the Monte Carlo simulations suggest that there is no "bridging" transition for sufficiently thin cells. The extent to which these geometrically patterned systems resemble topographically patterned substrates, such as square wells, is also discussed.