Of usually means "that is associated in some way with".
"This is the key of the door." = "This is the key that is associated in some way with the door." The way in which it is associated is that it locks and unlocks the door.
He held a bag of gold coins - He held a bag associated in some way with gold coins. The way in which it is associated is that it holds gold coins.
This is the view of the sea = This is the view that is associated in some way with the sea - the way in which it is associated is that when you see the view, you see the sea.
From usually tells you something about the origin of the noun and sometimes indicates a movement or change:
He made the sword from steel. - this tells you the origin of the metal used for the sword.
He walked from Italy to England- This says where he started, i.e. his origin.
The weather changed from rain to snow - This tells you what the weather was originally.
I saw the bird from the window. -This tells you your origin when you saw the bird.
A view from the sea = the view originating in the sea.