Grid cells are a special class of spatial cells found in the medial entorhinal cortex (MEC) characterized by their strikingly regular hexagonal firing fields. This spatially periodic firing pattern is originally considered to be independent of the geometric properties of the environment. However, this notion was contested by examining the grid cell periodicity in environments with different polarity (Krupic et al., 2015) and in connected environments (Carpenter et al., 2015). Aforementioned experimental results demonstrated the dependence of grid cell activity on environmental geometry. Analysis of grid cell periodicity on practically infinite variations of environmental geometry imposes a limitation on the experimental study. Hence we analyze the dependence of grid cell periodicity on the environmental geometry purely from a computational point of view. We use a hierarchical oscillatory network model where velocity inputs are presented to a layer of Head Direction cells, outputs of which are projected to a Path Integration layer. The Lateral Anti-Hebbian Network (LAHN) is used to perform feature extraction from the Path Integration neurons thereby producing a spectrum of spatial cell responses. We simulated the model in five types of environmental geometries such as: (1) connected environments, (2) convex shapes, (3) concave shapes, (4) regular polygons with varying number of sides, and (5) transforming environment. Simulation results point to a greater function for grid cells than what was believed hitherto. Grid cells in the model encode not just the local position but also more global information like the shape of the environment. Furthermore, the model is able to capture the invariant attributes of the physical space ingrained in its LAHN layer, thereby revealing its ability to classify an environment using this information. The proposed model is interesting not only because it is able to capture the experimental results but, more importantly, it is able to make many important predictions on the effect of the environmental geometry on the grid cell periodicity and suggesting the possibility of grid cells encoding the invariant properties of an environment. © 2019 Jayakumar, Narayanamurthy, Ramesh, Soman, Muralidharan and Chakravarthy.