Algorithmic Foundation of Multi-Scale Spatial Representation