As far as I understood, the first means "great and big", something magnificent and imposing. It collocates with mostly abstract nouns such as aim or prospect (宏伟前景,宏伟目标,宏伟事业), but it also collocates with buildings.
The second one also means grand and imposing and often collocates with natural scenery and with the figure of human body (雄伟场面, 雄伟身材).
What I don't understand is the occurrence of the two and when to use the first or the second. For example I have found 宏伟建筑, but also 一座雄伟的桥 and 气势雄伟长城...so my question is: is there a specific rule or each collocation has to be learned depending on the specific language context?