build static index using distance and time