A Formal Approach to Implement Dimension Independent Spatial