How is a unique room being represented and associated with locations?

This is a bit misleading. I was trying to show how GCMs could be used to represent space with SDRs, but that is not exactly how we use them in HTM theory. I suggest you read the paper: Locations in the Neocortex: A Theory of Sensorimotor Object Recognition Using Cortical Grid Cells.