Animals in the natural world constantly encounter geometrically complex landscapes. Successful navigation requires that they understand geometric features of these landscapes, including boundaries, landmarks, corners and curved areas, all of which collectively define the geometry of the environment1-12. Crucial to the reconstruction of the geometric layout of natural environments are concave and convex features, such as corners and protrusions. However, the neural substrates that could underlie the perception of concavity and convexity in the environment remain elusive. Here we show that the dorsal subiculum contains neurons that encode corners across environmental geometries in an allocentric reference frame. Using longitudinal calcium imaging in freely behaving mice, we find that corner cells tune their activity to reflect the geometric properties of corners, including corner angles, wall height and the degree of wall intersection. A separate population of subicular neurons encode convex corners of both larger environments and discrete objects. Both corner cells are non-overlapping with the population of subicular neurons that encode environmental boundaries. Furthermore, corner cells that encode concave or convex corners generalize their activity such that they respond, respectively, to concave or convex curvatures within an environment. Together, our findings suggest that the subiculum contains the geometric information needed to reconstruct the shape and layout of naturalistic spatial environments.