A metaphor is a comparison between two unlike things that does not use the words like or as. A metaphor that represents the use of space in The Metamorphosis appears in chapter 1. Gregor Samsa awakens in his bedroom, which is described as follows:
His room, a proper human room although a little too small.
The fact that the room is cramped or too small is a metaphor for his life as a whole. As we find out while he is thinking about how much he hates his job as a traveling salesman, we come to understand that Gregor has a cramped, unfulfilling life. He dislikes his work, which consumes all his time and energy, and he is only doing it to pay off debts his parents have incurred. He looks forward to the time he can quit and perhaps live more expansively than in a small room in his parents' home.
Another spatial metaphor appears after Samsa is badly injured after his father throws the apple at him that lodges in his carapace.
He had been reduced to the condition of an ancient invalid and it took him long, long minutes to crawl across his room ... but this deterioration in his condition was fully (in his opinion) made up for by the door to the living room being left open every evening.
Gregor is now compared to an ancient invalid who takes a long time to crawl across his small room. The door to the living room being left open becomes a metaphor for the sense of connection and expansion he feels now that he can observe his family and listen to their conversations. This almost makes up for his injuries.
Shortly after that, he remembers back to when he missed his family when he traveled:
Getting into the damp bed in some small hotel room.
Again, the small hotel room is a metaphor for his cramped life.