Nearest neighbor queries in spatial and spatio-temporal databases