Construction of the grid coordinate