Building a Foundation Model for Trajectory from Scratch