A computer-implemented method for operating an autonomous driving vehicle, ADV, travelling at a speed exceeding a predetermined value, the method comprising: generating a raw reference line in a global coordinate system for a planning phase of the ADV, wherein the raw reference line includes a series of discrete points forming a line that connects a starting location to a destination location for the planning phase; truncating the raw reference line based on a set of predefined criteria to obtain a truncated reference line; transferring said truncated reference line from the global coordinate system to a local coordinate system, the reference line including a plurality of discrete points in the local coordinate system, wherein the reference line represents an ideal route or path without any interference from others such as other vehicles, obstacles, or traffic condition, wherein each point of the plurality of discrete points is described in the local coordinate system by a horizontal coordinate and a vertical coordinate and wherein an x axis corresponding to a horizontal coordinate axis of the local coordinate system is the heading of the ADV at the beginning of the planning phase; determining, using a polynomial curve that best fits the plurality of points, a new vertical coordinate for a horizontal coordinate of each point on the truncated reference line in the local coordinate system; transferring points represented by each new vertical coordinate and its corresponding horizontal coordinate back to the global coordinate system; and determining, using the polynomial curve, a heading direction, a kappa, and a dkappa for each transferred point, wherein the kappa represents a curvature and the dkappa represents a rate of curvature; and wherein the transferred points and the heading direction, the kappa and the dkappa for each point are used to create a new reference line for the ADV, wherein the new reference line defines a route to be followed by the ADV. generating a raw reference line in a global coordinate system for a planning phase of the ADV, wherein the raw reference line includes a series of discrete points forming a line that connects a starting location to a destination location for the planning phase; truncating the raw reference line based on a set of predefined criteria to obtain a truncated reference line; transferring said truncated reference line from the global coordinate system to a local coordinate system, the reference line including a plurality of discrete points in the local coordinate system, wherein the reference line represents an ideal route or path without any interference from others such as other vehicles, obstacles, or traffic condition, wherein each point of the plurality of discrete points is described in the local coordinate system by a horizontal coordinate and a vertical coordinate and wherein an x axis corresponding to a horizontal coordinate axis of the local coordinate system is the heading of the ADV at the beginning of the planning phase; determining, using a polynomial curve that best fits the plurality of points, a new vertical coordinate for a horizontal coordinate of each point on the truncated reference line in the local coordinate system; transferring points represented by each new vertical coordinate and its corresponding horizontal coordinate back to the global coordinate system; and determining, using the polynomial curve, a heading direction, a kappa, and a dkappa for each transferred point, wherein the kappa represents a curvature and the dkappa represents a rate of curvature; and wherein the transferred points and the heading direction, the kappa and the dkappa for each point are used to create a new reference line for the ADV, wherein the new reference line defines a route to be followed by the ADV.