Local adaptation mediated niche expansion in correlation with genetic richness