building a refernce database for localization