The high-precision positioning of mileage piles on a digital map ensures accurate data for various applications, such as high-speed event releases, toll audits, and road condition monitoring. This paper introduces an efficient and automatic system for positioning highway mileage piles. The self-developed data acquisition system collects images of mileage pile and road trajectory data. Considering the limited variety of mileage piles, a Simplified YOLOv5m (S-YOLOv5m) is proposed. Then a high-precision character detection network of S-YOLOv5m (HPCDS-YOLOv5m) is proposed to enhance feature extraction and improve the accuracy of character detection on mileage piles. Thirdly, the end-to-end monocular distance measurement combines the target detection with the distance estimation, enabling simultaneous detection and distance measurement of mileage piles. Forthly, by combining with the geographical coordinates of the acquisition point, the direct solution to geodetic problems is applied to calculate the spatial coordinates of the mileage piles. Finally, the missing mileage piles are compensated for using the road curve and equal distance interpolation. The completed mileage pile and its geographic information list are output. Through a series of verification tests, the average positioning error of the mileage pile system is 1.265 m. The contribution of the automatic positioning system of mileage piles is to construct the relationship between mileage piles and geographical coordinates, match mileage piles with digital maps, and realise the full-featured, real-scene, and high-dynamic management of road attributes.