The invention discloses a
line segment vacuating device for an
electronic map and a method thereof. The device comprises a map lead-in module, a threshold value setting module, a
vertical distance calculating module, an included angle calculating module and a
line segment vacuating module. A straight line enabling a head point PS of a curve to be connected with a
tail point PE of the curve serves as a datum line, the maximum
vertical distance dm from other end points on the curve to the straight line PS-PE is calculated, the point with the maximum
vertical distance is recorded as Pm, an included
angle alpha formed by the vector PS-Pm and the vector Pm-PE is calculated out, compared the dm with the D, the a and the A, if dm<=D and a <=A, then only the head point PS and the
tail point PE of the curve are retained, all other points are removed; if dm> D and a>A, then the Pm point separates the curve into two portions, vertical distance calculating, included angle calculating and
line segment vacuating are repeatedly carried out on the two portions, until the dm>=D and a>=A. The line segment vacuating device can not only guarantee vacuating vigor and certain
compression ratio, but also give consideration to vacuating deformation and guarantee smoothness of line segment after vacuating, and cannot enable original line forms to be excessively distorted.