A group theoretical approach to the canonical quantisation of gravity. I. Construction of the canonical group