Optimization of earth-rock allocation is an important problem in subgrade construction of road engineering. Based on systematical analysis of composition and allocation relations of earth-rock allocation system, we develop the linear programming optimization model for earth-rock allocation in road engineering to achieve the minimum cost of the system. The model takes into account excavation, fill sections, borrow pits, disposal sites and disposal materials. And we constitute the coordinate system for earth-rock allocation to calculate transportation distances. It remarkably decreases the required data amount in optimization calculation and improves the practicability of the model in project practice. Application in actual projects shows that the model realizes optimal earth-rock allocation in road engineering, increases the cut materials usage, reduces borrow and disposal amount, realizes the minimum cost of earth-rock allocation system and environment protection along the road ultimately. The model can be used in earth-rock allocation of road engineering and levee engineering widely.