Recent studies have shown that haptic sensing can be used effectively for legged robot localization in extreme scenarios where vision sensors might fail, such as mines and sewers. However, existing methods use supervised classification, with training and evaluation executed over explicit terrain classes. This is a significant limitation in real-world applications, where prior labeling and handcrafted classes are often impractical. In this paper, we propose a novel haptic localization system based on a fully unsupervised terrain representation learned solely from the force/torque sensors located at the quadruped robot's feet. Instead of using the detected terrain class for localization, we propose an improved autoencoder architecture to generate a sparse map on the first run and to localize against the sparse map during subsequent runs. We compare our approach to a haptic localization system based on supervised terrain classification, showing that the unsupervised method has comparable or better performance than the supervised one for the same trajectories while clearly outperforming the proprioceptive odometry estimator available on the robot. The proposed approach is therefore well-suited for a routine maintenance application, increasing the robustness of the platform.