The present invention relates to the field of
label placement technology, and discloses a method and
system for placing labels inside a polygonal area. The method processes the boundary of the polygonal area to generate a plurality of distribution points, and generates a
label according to the distribution points. Voronoi Figure; based on Voronoi The simplified path of the polygonal area is obtained by graph planning and optimization; the minimum
vertical distance from the simplified path to the boundary is calculated, and the maximum allowable height of the
label that can be placed in the polygonal area is calculated based on the minimum
vertical distance, and the maximum
font size of the label that can be placed in the polygonal area is calculated based on the maximum allowable height; the label is adjusted to the maximum
font size, and its geometric center coincides with the geometric center of the simplified path, and the label is placed in the polygonal area based on the simplified path. It is applicable to various complex polygonal areas and determines the best placement position and maximum
font size of the label in the polygonal area. It has excellent performance in visual aesthetics, user experience and scene adaptability, and has better adaptability and promotion in practical applications.