CN106297536B - Method and device for determining labeling position of planar graphic element name in electronic map - Google Patents

Method and device for determining labeling position of planar graphic element name in electronic map Download PDF

Info

Publication number
CN106297536B
CN106297536B CN201510236494.8A CN201510236494A CN106297536B CN 106297536 B CN106297536 B CN 106297536B CN 201510236494 A CN201510236494 A CN 201510236494A CN 106297536 B CN106297536 B CN 106297536B
Authority
CN
China
Prior art keywords
circle center
point
center position
initial
polygon
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510236494.8A
Other languages
Chinese (zh)
Other versions
CN106297536A (en
Inventor
李永超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Autonavi Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Autonavi Software Co Ltd filed Critical Autonavi Software Co Ltd
Priority to CN201510236494.8A priority Critical patent/CN106297536B/en
Publication of CN106297536A publication Critical patent/CN106297536A/en
Application granted granted Critical
Publication of CN106297536B publication Critical patent/CN106297536B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention relates to a method and a device for determining the labeling position of a planar graphic primitive name in an electronic map. The method comprises the following steps: acquiring the position of the central point of a circumscribed polygon of the planar primitive; acquiring the position of the central point of an inscribed polygon of the planar primitive according to the position of the central point of the circumscribed polygon; and setting the position of the central point of the inscribed polygon as a reference position for marking the name of the planar graphic element. The method can improve the display effect of the electronic map.

Description

Method and device for determining labeling position of planar graphic element name in electronic map
Technical Field
The invention relates to the field of electronic maps, in particular to a method and a device for determining the labeling position of a planar graphic primitive name in an electronic map.
Background
The electronic map is a map that is digitally stored and referred by using a computer technology, and a user can find a place, a travel route, and the like through the electronic map. The electronic map is convenient for people to live and work.
The electronic map data includes at least three kinds of data: planar elements (actually, indicated by a polygon), lines, and dots, wherein the planar elements are used to indicate a real water area, a green space, an island, an administrative area, and the like. The people park as shown in fig. 1 can be made into a pentagonal planar primitive in the electronic map.
Generally, the prior art method for labeling a name of a planar primitive in an electronic map is as follows: for any planar graphic element, firstly determining an outsourcing rectangular frame of the planar graphic element, then calculating the central point position of the outsourcing rectangular frame, and setting the central point position as the position for marking the name of the planar graphic element in the electronic map.
However, in the process of researching the prior art, the inventor finds that, for an irregular planar primitive, the position of the center point of the outsourcing rectangular frame is used as the position for marking the name of the planar primitive, so that the problem that the marked name exceeds the coverage range of the planar primitive or overlaps with the marked name of the adjacent planar primitive occurs, and the display effect of the electronic map is poor. The name "Kunming lake" of the planar graphic element marked in the electronic map shown in FIG. 2 is beyond the coverage of the Kunming lake.
Disclosure of Invention
The invention aims to provide a method and a device for determining the marking position of a planar graphic element name in an electronic map, so as to solve the problem of poor display effect of the electronic map caused by marking the planar graphic element name in the related technology.
In one aspect, the present invention provides a method for determining a labeling position of a name of a planar primitive in an electronic map, including:
acquiring the position of the central point of a circumscribed polygon of the planar primitive;
acquiring the position of the central point of an inscribed polygon of the planar primitive according to the position of the central point of the circumscribed polygon;
and setting the position of the central point of the inscribed polygon as a reference position for marking the name of the planar graphic element.
In another aspect, the present invention provides an apparatus for determining a labeling position of a name of a planar primitive in an electronic map, including:
the outer central point position acquisition module is used for acquiring the central point position of a circumscribed polygon of the planar primitive;
the inner central point position acquisition module is used for acquiring the central point position of an inscribed polygon of the planar primitive according to the central point position of the circumscribed polygon;
and the reference position determining module is used for setting the position of the central point of the inscribed polygon as the reference position for marking the name of the planar graphic element.
The invention has at least the following beneficial effects: the invention provides a method for determining the labeling position of a planar graphic element name in an electronic map. The invention sets the central point position of the inscribed polygon of the planar primitive as the reference position for marking the name of the planar primitive, and the inscribed polygon is an internal area of the planar primitive, thereby, the invention reduces the area range for marking the name of the planar primitive to the internal of the planar primitive, therefore, the technical scheme provided by the invention can solve the problem that the name marked in the prior art exceeds the coverage range of the planar primitive or is overlapped with the name marked by the adjacent planar primitive, and improves the display effect of the electronic map.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
FIG. 1 is a diagram illustrating a planar primitive and its name in the prior art;
FIG. 2 is an effect diagram of labeling names of planar primitives of a Kunming lake according to the prior art;
fig. 3 is an exemplary flowchart of a method for determining a labeling position of a name of a planar primitive in an electronic map according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating a determination of a center of a circle of a target according to an embodiment of the present invention;
FIG. 5 is a second flowchart illustrating a method for determining a labeling position of a name of a planar primitive in an electronic map according to an embodiment of the present invention;
FIG. 6 is an effect diagram of labeling names of planar primitives of a Kunming lake by using the technical scheme provided by the invention;
fig. 7 is a schematic diagram of an apparatus for determining a labeling position of a name of a planar primitive in an electronic map according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in conjunction with the accompanying drawings, and it should be understood that the embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not intended to limit the present invention.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The invention provides a method for determining the labeling position of a planar graphic element name in an electronic map. The invention sets the central point position of the inscribed polygon of the planar primitive as the reference position for marking the name of the planar primitive, and the inscribed polygon is an internal area of the planar primitive, thereby, the invention reduces the area range for marking the name of the planar primitive to the internal of the planar primitive, therefore, the technical scheme provided by the invention can solve the problem that the name marked in the prior art exceeds the coverage range of the planar primitive or is overlapped with the name marked by the adjacent planar primitive, and improves the display effect of the electronic map.
The following describes a method for determining a labeling position of a name of a planar primitive in an electronic map in an embodiment of the present invention in detail.
Example one
As shown in fig. 3, an exemplary flowchart of a method for determining a labeling position of a name of a planar primitive in an electronic map according to an embodiment of the present invention is shown, where the method includes the following steps:
step 301: and acquiring the central point position of the circumscribed polygon of the planar primitive.
Step 302: and acquiring the central point position of the inscribed polygon of the planar primitive according to the central point position of the circumscribed polygon.
In order to find a maximum area capable of being used for labeling a name inside the planar primitive, the inscribed polygon in step 302 may be a circle, a rectangle, an ellipse, or the like, and the specific shape of the inscribed polygon may depend on the shape of the planar primitive.
Step 303: and setting the position of the central point of the inscribed polygon as a reference position for marking the name of the planar graphic element.
Preferably, in order to further improve the display effect of the electronic map and avoid the problem that the labeled name exceeds the coverage range of the planar primitive or overlaps with the labeled name of the adjacent planar primitive, the reference position is taken as a reference, and the name of the planar primitive is labeled in the inscribed polygon. When the name of the planar primitive can be scaled, the layout manner of the name of the planar primitive may also be determined according to the specific shape of the inscribed polygon, so that the name of the planar primitive is marked inside the inscribed polygon. The typesetting mode includes the arrangement direction of the characters, the size of the characters, the word space, the line space, the number of the characters in each line and the like.
The aforesaid inscribed polygon may be a rectangle, a circle or other polygons, and the following takes a rectangle and a circle as examples respectively, and detailed description will be given to specific implementation means for obtaining the position of the center point of the inscribed polygon of the planar primitive according to the position of the center point of the circumscribed polygon provided in the embodiments of the present invention.
Firstly, when the inscribed polygon is a rectangle, the acquiring the position of the central point of the inscribed polygon of the planar primitive according to the position of the central point of the circumscribed polygon specifically includes:
step A1: and acquiring the position of the central point of the circumscribed polygon of the planar primitive, and taking the position of the central point as the position of an initial central point.
Step A2: and traversing the shape points on the boundary of the planar primitive, searching an inscribed rectangle which takes the initial central point position as a central point and takes the shape point on the boundary of at least one planar primitive as a vertex, and acquiring the area of the inscribed rectangle.
Step A3: and moving the central point position according to a preset step length, judging whether the moved central point position exceeds or falls on the boundary of the planar graphic element, if so, entering the step A4, otherwise, taking the moved central point position as the initial central point position, and returning to the step A2.
Step A4: and comparing the areas of all inscribed rectangles, and determining the initial central point position corresponding to the inscribed rectangle with the largest area as the central point position of the inscribed polygon of the planar primitive.
Secondly, when the inscribed polygon is an inscribed circle, the step of obtaining the position of the central point of the inscribed polygon of the planar primitive according to the position of the central point of the circumscribed polygon specifically comprises the following steps:
step B1: and taking the position of the central point of the circumscribed polygon as the initial circle center position of the inscribed circle.
The outer enclosure frame may be a rectangular outer enclosure frame, or a circular outer enclosure frame, and may be determined according to actual needs in specific implementation, which is not limited in the present invention.
Step B2: and obtaining the distance from the initial circle center position to each edge of the circumscribed polygon.
Step B3: and moving the initial circle center position according to a preset step length to obtain a target circle center position.
Step B4: and obtaining the distance from the center position of the target circle to each edge of the circumscribed polygon.
Step B5: and comparing the shortest distance from the initial circle center position to each side of the circumscribed polygon with the shortest distance from the target circle center position to each side of the circumscribed polygon.
Step B6: if the shortest distance from the initial circle center position to each side of the circumscribed polygon is smaller than the shortest distance from the target circle center position to each side of the circumscribed polygon, taking the target circle center position as the initial circle center position of the inscribed circle, and returning to the step B2.
Step B7: and if the shortest distance from the initial circle center position to each side of the circumscribed polygon is greater than or equal to the shortest distance from the target circle center position to each side of the circumscribed polygon, shortening the step length in proportion to obtain a new step length.
Step B8: and if the new step length is smaller than a preset step length threshold value, taking the initial circle center position as the central point position of the inscribed circle of the planar primitive, and if the new step length is larger than or equal to the preset step length threshold value, taking the new step length as the preset step length, and returning to the step B3.
In one embodiment, step B3 may be specifically executed as the following:
step C1: and acquiring a foot hanging position point A and a foot hanging position point B from an initial circle center position to a first edge and a second edge of the circumscribed polygon, wherein the first edge and the second edge are respectively corresponding to the shortest distance and the second shortest distance from the initial circle center position to each edge of the circumscribed polygon.
Step C2: selecting a reference position point C on a connecting line of the drop foot position point A and the drop foot position point B according to the following formula (1):
CA/CB=OA/OB (1)
wherein, in formula (1), the O represents an initial center position; said a represents said drop foot location point a; said B represents said drop foot location point B; c represents the reference location point; the OA represents the distance between the initial circle center position and the drop foot position point A; OB represents the distance between the initial circle center position and the drop foot position point B; the CA represents a distance between the reference location point and the drop foot location point A; the CB represents the distance between the reference position point and the drop foot position point B.
Step C3: and acquiring a position point which is positioned on an extension line of a connecting line of the reference position point C and the initial circle center position and has a distance to the initial circle center position equal to a preset step length, and taking the position point as a target circle center position.
Wherein, in one embodiment, step C3 may be performed as: calculating the abscissa and the ordinate of the center position of the target circle according to the following formula (2);
Figure BDA0000714831270000061
(2)
Figure BDA0000714831270000062
wherein, in formula (2), the total of o'xAn abscissa representing the position of the center of the target circle; d represents a preset step length; said oxAn abscissa representing an initial circle center position; c is mentionedxRepresents the abscissa of the reference position point C; said DcoRepresenting the distance from the reference position point C to the initial circle center position; o 'to'yA vertical coordinate representing the position of the center of the target circle; said oyA vertical coordinate representing the initial circle center position; c is mentionedyIndicating the ordinate of the reference position point C.
A schematic diagram of the method for determining the center position of the target circle is shown in fig. 4: in fig. 4, a center point position O of a circumscribed polygon of the planar primitive is determined, the center point position is used as an initial center point position, and then distances from the initial center point position O to each side of the planar primitive are calculated, wherein the distance from O to the side L1 of the planar primitive is the shortest, and the distance to the side L2 of the planar primitive is the second shortest. In fig. 4, point a is a drop foot position point from O to L1, point B is a drop foot position point from O to L2, R1 represents a distance between O, A and R2 represents a distance between O, B. After the drop foot position point is determined, a reference position point C is determined on the line connecting the drop foot position point A, B according to equation (1). Then, according to the formula (2), a is taken as a preset step length, and a target circle center position O' is determined on the extension line of the CO. And then, calculating the distance from the O 'to each edge of the planar primitive, and acquiring the shortest distance from the O' to each edge of the planar primitive. In fig. 4, the distance R1 'from the side O' to the side L1 is still the shortest distance, and as can be seen from fig. 4, R1 'is greater than R1, so that the target position point can be continuously searched by using O' as a new initial center position until the center of the maximum inscribed circle is found.
Through the method, the determined inscribed circle is the largest inscribed circle of the planar primitive, and the largest inscribed circle is the largest area capable of being marked with the name in the planar primitive, so that the technical scheme provided by the embodiment of the invention can avoid the problem that the marked name exceeds the coverage range of the planar primitive or is overlapped with the marked name of the adjacent planar primitive, and the display quality of the electronic map is improved.
In summary, in an embodiment of the present invention, a method for determining a labeling position of a name of a planar primitive in an electronic map is provided, in which a center point position of an inscribed polygon of the planar primitive is set as a reference position for labeling the name of the planar primitive. The invention sets the central point position of the inscribed polygon of the planar primitive as the reference position for marking the name of the planar primitive, and the inscribed polygon is an internal area of the planar primitive, thereby, the invention reduces the area range for marking the name of the planar primitive to the internal of the planar primitive, therefore, the technical scheme provided by the invention can solve the problem that the name marked in the prior art exceeds the coverage range of the planar primitive or is overlapped with the name marked by the adjacent planar primitive, and improves the display effect of the electronic map.
In addition, when the method provided by the embodiment of the invention is applied to the manufacturing process of the electronic map data, the specific name corresponding to each planar graphic element can not be concerned because the area taking the inscribed polygon as the label name is determined in the planar graphic element. Therefore, the method provided by the embodiment of the invention can complete the determination of the labeling position of the name of the planar graphics primitive with higher efficiency.
Example two
The planar primitive of the kunming lake in the electronic map is an irregular polygon, and the following takes as an example that the name of the planar primitive of the kunming lake is marked at the maximum inscribed circle of the planar primitive, and a method for marking the name of the planar primitive in the electronic map in the embodiment of the present invention is described in detail, as shown in fig. 5, the method includes the following steps:
step 501: determining the position of the central point of a circumscribed polygon of a planar graphic element of the Kunming lake, and taking the position of the central point as the initial center position of the inscribed circle.
Step 502: and obtaining the distance from the initial circle center position to each edge of the circumscribed polygon.
Step 503: and acquiring a foot hanging position point A and a foot hanging position point B from an initial circle center position to a first edge and a second edge of the circumscribed polygon, wherein the first edge and the second edge are respectively corresponding to the shortest distance and the second shortest distance from the initial circle center position to each edge of the circumscribed polygon.
Step 504: and (3) selecting a reference position point C on a connecting line of the drop foot position point A and the drop foot position point B according to a formula (1).
The formula (1) has been described in detail in the first embodiment, and is not described herein again.
Step 505: and (3) calculating the abscissa and the ordinate of the target circle center position according to the formula (2) to obtain the target circle center position.
The formula (2) has been described in detail in the first embodiment, and is not described herein again.
Step 506: and obtaining the distance from the center position of the target circle to each edge of the circumscribed polygon.
Step 507: and judging whether the shortest distance from the initial circle center position to each side of the circumscribed polygon is smaller than the shortest distance from the target circle center position to each side of the circumscribed polygon, if so, executing a step 508, and if not, executing a step 509.
Step 508: and taking the target circle center position as the initial circle center position of the inscribed circle, and returning to the step 502.
Step 509: and shortening the step length according to the proportion to obtain a new step length, if the new step length is smaller than a preset step length threshold value, taking the initial circle center position as the central point position of the inscribed circle of the planar primitive, and if the new step length is larger than or equal to the preset step length threshold value, taking the new step length as the preset step length, and returning to the step 503.
Step 510: and setting the central point position of the inscribed circle of the determined planar graphic element as a reference position for marking the name of the planar graphic element.
Step 511: and marking the name of the planar graphic element in the inner part of the inscribed polygon by taking the reference position as a reference.
The effect diagram labeled in steps 501-511 after the name of the planar primitive of the queenshu lake is shown in fig. 6, and it can be seen from comparing fig. 6 and fig. 2 (fig. 2 is a schematic diagram of the name of the planar primitive labeled in the prior art, namely the queenshu lake), that compared to the name of the planar primitive labeled in the prior art, the name of the planar primitive labeled in the present invention is not overlapped with the boundary of the planar primitive. Therefore, the method for determining the labeling position of the name of the planar graphic element in the electronic map provided by the embodiment of the invention can improve the display effect of the electronic map.
EXAMPLE III
Based on the same inventive concept, the present invention further provides an apparatus for determining labeling positions of names of planar primitives in an electronic map, as shown in fig. 7, the apparatus includes:
an outer center point position obtaining module 701, configured to obtain a center point position of an outer polygon of the planar primitive;
an inner center point position obtaining module 702, configured to obtain a center point position of an inscribed polygon of the planar primitive according to the center point position of the circumscribed polygon;
a reference position determining module 703, configured to set a center point position of the inscribed polygon as a reference position for labeling a name of the planar primitive.
Wherein, in one embodiment, the apparatus further comprises:
and the marking module is used for setting the position of the central point of the inscribed polygon as a reference position for marking the name of the planar graphic element.
In an embodiment, the module 702 for obtaining the location of the inner center point specifically includes:
an initial circle center determining unit, configured to, if the inscribed polygon is an inscribed circle, take a position of a center point of the circumscribed polygon as an initial circle center position of the inscribed circle;
the first distance acquisition unit is used for acquiring the distance from the initial circle center position to each edge of the circumscribed polygon;
the target circle center determining unit is used for moving the initial circle center position according to a preset step length to obtain a target circle center position;
the second distance obtaining unit is used for obtaining the distance from the center position of the target circle to each edge of the circumscribed polygon;
the comparison unit is used for comparing the shortest distance from the initial circle center position to each side of the circumscribed polygon with the shortest distance from the target circle center position to each side of the circumscribed polygon;
the first processing unit is used for taking the target circle center position as the initial circle center position of the inscribed circle and triggering the first distance acquisition unit to execute operation if the former is smaller than the latter;
and the second processing unit is used for shortening the step length in proportion to obtain a new step length if the former is larger than or equal to the latter, taking the initial circle center position as the central point position of the inscribed circle of the planar primitive if the new step length is smaller than a preset step length threshold, taking the new step length as the preset step length if the new step length is larger than or equal to the preset step length threshold, and triggering the target circle center determining unit to execute the operation.
In an embodiment, the target circle center determining unit specifically includes:
the device comprises a foot drop point acquisition subunit, a foot drop point acquisition subunit and a foot drop point acquisition subunit, wherein the foot drop point acquisition subunit is used for acquiring a foot drop position point A and a foot drop position point B from an initial circle center position to a first edge and a second edge of the circumscribed polygon, and the first edge and the second edge are respectively corresponding to the shortest distance and the next shortest distance from the initial circle center position to each edge of the circumscribed polygon;
a reference position point obtaining subunit, configured to select a reference position point C on a connection line between the foot position point a and the foot position point B according to a formula CA/CB, where O denotes an initial circle center position, and OA, OB, CA, and CB respectively denote distances between the positions;
and the target circle center determining subunit is used for acquiring a position point which is positioned on an extension line of a connecting line of the reference position point C and the initial circle center position and has a distance to the initial circle center position equal to a preset step length, and taking the position point as the target circle center position.
In one embodiment, the target circle center determining subunit is specifically configured to calculate an abscissa and an ordinate of a position of a target circle center according to the following formulas;
Figure BDA0000714831270000111
Figure BDA0000714831270000112
wherein, the o'xAn abscissa representing the position of the center of the target circle; d represents a preset step length; said oxAn abscissa representing an initial circle center position; c is mentionedxRepresents the abscissa of the reference position point C; said DcoRepresenting the distance from the reference position point C to the initial circle center position; o 'to'yA vertical coordinate representing the position of the center of the target circle; said oyA vertical coordinate representing the initial circle center position; c is mentionedyIndicating the ordinate of the reference position point C.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for determining labeling positions of planar graphic element names in an electronic map is characterized by comprising the following steps:
acquiring the position of the central point of a circumscribed polygon of the planar primitive;
acquiring the central point position of the inscribed polygon with the largest area of the planar primitive according to the central point position of the circumscribed polygon, wherein the central point position of the inscribed polygon with the largest area is obtained by taking the central point position of the circumscribed polygon as an initial position and moving the initial position;
and setting the central point position of the inscribed polygon with the largest area as a reference position for marking the name of the planar graphic element.
2. The method of claim 1, further comprising:
and marking the name of the planar graphic element in the inner part of the inscribed polygon by taking the reference position as a reference.
3. The method according to claim 1 or 2, wherein if the inscribed polygon is an inscribed circle, the obtaining of the position of the center point of the inscribed polygon of the planar primitive according to the position of the center point of the circumscribed polygon specifically includes:
taking the position of the central point of the circumscribed polygon as the initial circle center position of the inscribed circle;
obtaining the distance from the initial circle center position to each edge of the circumscribed polygon;
moving the initial circle center position according to a preset step length to obtain a target circle center position;
obtaining the distance from the center position of the target circle to each edge of the circumscribed polygon;
comparing the shortest distance from the initial circle center position to each side of the circumscribed polygon with the shortest distance from the target circle center position to each side of the circumscribed polygon;
if the former is smaller than the latter, taking the target circle center position as the initial circle center position of the inscribed circle, and returning to the step of obtaining the distance from the initial circle center position to each edge of the circumscribed polygon;
if the former is larger than or equal to the latter, shortening the step length in proportion to obtain a new step length, if the new step length is smaller than a preset step length threshold, taking the initial circle center position as the central point position of the inscribed circle of the planar primitive, and if the new step length is larger than or equal to the preset step length threshold, taking the new step length as the preset step length, and returning to the step of moving the initial circle center position according to the preset step length to obtain the target circle center position.
4. The method according to claim 3, wherein moving the initial circle center position according to a preset step length to obtain a target circle center position specifically comprises:
obtaining a foot hanging position point A and a foot hanging position point B from an initial circle center position to a first edge and a second edge of the circumscribed polygon, wherein the first edge and the second edge are respectively corresponding to the shortest distance and the next shortest distance from the initial circle center position to each edge of the circumscribed polygon;
selecting a reference position point C on a connecting line of the foot position point A and the foot position point B according to a formula of OA/CB (OA/OB), wherein O represents an initial circle center position, and OA, OB, CA and CB respectively represent distances among the positions;
and acquiring a position point which is positioned on an extension line of a connecting line of the reference position point C and the initial circle center position and has a distance to the initial circle center position equal to a preset step length, and taking the position point as a target circle center position.
5. The method according to claim 4, wherein the obtaining a position point which is located on an extension line of a connecting line of the reference position point C and the initial circle center position and has a distance to the initial circle center position equal to a preset step length, and taking the position point as a target circle center position specifically comprises:
calculating the abscissa and the ordinate of the center position of the target circle according to the following formulas;
Figure FDA0002267479600000021
Figure FDA0002267479600000022
wherein, the o'xAn abscissa representing the position of the center of the target circle; d represents a preset step length; said oxAn abscissa representing an initial circle center position; c is mentionedxRepresents the abscissa of the reference position point C; said DcoRepresenting the distance from the reference position point C to the initial circle center position; o 'to'yA vertical coordinate representing the position of the center of the target circle; said oyA vertical coordinate representing the initial circle center position; c is mentionedyIndicating the ordinate of the reference position point C.
6. An apparatus for determining labeling positions of names of planar graphical elements in an electronic map, the apparatus comprising:
the outer central point position acquisition module is used for acquiring the central point position of a circumscribed polygon of the planar primitive;
an inner central point position obtaining module, configured to obtain a central point position of an inscribed polygon with a largest area of the planar primitive according to a central point position of the circumscribed polygon, where the central point position of the inscribed polygon with the largest area is obtained by taking the central point position of the circumscribed polygon as an initial position and moving the initial position;
and the reference position determining module is used for setting the position of the central point of the inscribed polygon with the largest area as the reference position for marking the name of the planar graphic element.
7. The apparatus of claim 6, further comprising:
and the marking module is used for setting the position of the central point of the inscribed polygon as a reference position for marking the name of the planar graphic element.
8. The apparatus according to claim 6 or 7, wherein the inner center point position obtaining module specifically includes:
an initial circle center determining unit, configured to, if the inscribed polygon is an inscribed circle, take a position of a center point of the circumscribed polygon as an initial circle center position of the inscribed circle;
the first distance acquisition unit is used for acquiring the distance from the initial circle center position to each edge of the circumscribed polygon;
the target circle center determining unit is used for moving the initial circle center position according to a preset step length to obtain a target circle center position;
the second distance obtaining unit is used for obtaining the distance from the center position of the target circle to each edge of the circumscribed polygon;
the comparison unit is used for comparing the shortest distance from the initial circle center position to each side of the circumscribed polygon with the shortest distance from the target circle center position to each side of the circumscribed polygon;
the first processing unit is used for taking the target circle center position as the initial circle center position of the inscribed circle and triggering the first distance acquisition unit to execute operation if the former is smaller than the latter;
and the second processing unit is used for shortening the step length in proportion to obtain a new step length if the former is larger than or equal to the latter, taking the initial circle center position as the central point position of the inscribed circle of the planar primitive if the new step length is smaller than a preset step length threshold, taking the new step length as the preset step length if the new step length is larger than or equal to the preset step length threshold, and triggering the target circle center determining unit to execute the operation.
9. The apparatus according to claim 8, wherein the target circle center determining unit specifically includes:
the device comprises a foot drop point acquisition subunit, a foot drop point acquisition subunit and a foot drop point acquisition subunit, wherein the foot drop point acquisition subunit is used for acquiring a foot drop position point A and a foot drop position point B from an initial circle center position to a first edge and a second edge of the circumscribed polygon, and the first edge and the second edge are respectively corresponding to the shortest distance and the next shortest distance from the initial circle center position to each edge of the circumscribed polygon;
a reference position point obtaining subunit, configured to select a reference position point C on a connection line between the foot position point a and the foot position point B according to a formula CA/CB, where O denotes an initial circle center position, and OA, OB, CA, and CB respectively denote distances between the positions;
and the target circle center determining subunit is used for acquiring a position point which is positioned on an extension line of a connecting line of the reference position point C and the initial circle center position and has a distance to the initial circle center position equal to a preset step length, and taking the position point as the target circle center position.
10. The apparatus according to claim 9, wherein the target circle center determining subunit is specifically configured to calculate the abscissa and the ordinate of the target circle center position according to the following formulas;
Figure FDA0002267479600000041
Figure FDA0002267479600000042
wherein, the o'xAn abscissa representing the position of the center of the target circle; d represents a preset step length; said oxAn abscissa representing an initial circle center position; c is mentionedxRepresents the abscissa of the reference position point C; said DcoRepresenting the distance from the reference position point C to the initial circle center position; o 'to'yA vertical coordinate representing the position of the center of the target circle; said oyA vertical coordinate representing the initial circle center position; c is mentionedyIndicating the ordinate of the reference position point C.
CN201510236494.8A 2015-05-11 2015-05-11 Method and device for determining labeling position of planar graphic element name in electronic map Active CN106297536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510236494.8A CN106297536B (en) 2015-05-11 2015-05-11 Method and device for determining labeling position of planar graphic element name in electronic map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510236494.8A CN106297536B (en) 2015-05-11 2015-05-11 Method and device for determining labeling position of planar graphic element name in electronic map

Publications (2)

Publication Number Publication Date
CN106297536A CN106297536A (en) 2017-01-04
CN106297536B true CN106297536B (en) 2020-04-14

Family

ID=57630632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510236494.8A Active CN106297536B (en) 2015-05-11 2015-05-11 Method and device for determining labeling position of planar graphic element name in electronic map

Country Status (1)

Country Link
CN (1) CN106297536B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107689083B (en) * 2017-09-01 2020-09-15 武大吉奥信息技术有限公司 Self-adaptive geometric surface information labeling method and device for geographic information system
CN109726368B (en) * 2017-10-31 2021-09-28 腾讯科技(深圳)有限公司 Map marking method and device
CN108170807B (en) * 2017-12-28 2020-12-22 百度在线网络技术(北京)有限公司 Map data processing method, map drawing method, map data processing device, map drawing device, map data processing equipment and storage medium
CN113805773A (en) * 2021-08-24 2021-12-17 上海联影医疗科技股份有限公司 Image display method, image display device, computer equipment and storage medium
CN117456048B (en) * 2023-12-21 2024-04-19 福瑞莱环保科技(深圳)股份有限公司 Object labeling method and device in electronic map

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508605A (en) * 2011-11-10 2012-06-20 深圳市凯立德科技股份有限公司 Multimode map movement control method and location-based service terminal
CN102968926A (en) * 2012-05-25 2013-03-13 中国科学院地理科学与资源研究所 Symbol configuration system of zonal statistical map and method thereof
CN104361002A (en) * 2014-09-29 2015-02-18 中国科学院国家天文台 Method and device for configuring fixed spotty thematic symbols on network map

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100844467B1 (en) * 2007-10-22 2008-07-07 주식회사 디디알소프트 A simulation system and method for construction progression state with 3d

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508605A (en) * 2011-11-10 2012-06-20 深圳市凯立德科技股份有限公司 Multimode map movement control method and location-based service terminal
CN102968926A (en) * 2012-05-25 2013-03-13 中国科学院地理科学与资源研究所 Symbol configuration system of zonal statistical map and method thereof
CN104361002A (en) * 2014-09-29 2015-02-18 中国科学院国家天文台 Method and device for configuring fixed spotty thematic symbols on network map

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《地图中面状要素标注算法的设计与改进》;朱正国等;《西华大学学报(自然科学版)》;20090331;第38-42页 *

Also Published As

Publication number Publication date
CN106297536A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN106297536B (en) Method and device for determining labeling position of planar graphic element name in electronic map
CN110472534A (en) 3D object detection method, device, equipment and storage medium based on RGB-D data
CN108267154B (en) Map display method and device
US8126209B2 (en) Road image analyzing apparatus and road image analyzing method
CN103846192A (en) Autonomous-positioning type intelligent dispensing system
CN110570434A (en) image segmentation and annotation method and device
CN108573251B (en) Character area positioning method and device
CN108197567B (en) Method, apparatus and computer readable medium for image processing
TWI497420B (en) Two-dimentional optical indetification device with same gray level for quickly decoding and method for decoding the same
CN109472786B (en) Cerebral hemorrhage image processing method, device, computer equipment and storage medium
CN109636820A (en) Electronic map lane line modification method, equipment and computer readable storage medium
JP2022541977A (en) Image labeling method, device, electronic device and storage medium
CN113590005B (en) Labeling method and device of polygonal vector map, electronic equipment and storage medium
CN111914046A (en) Generation method and device of target seating chart and computer equipment
CN110458954B (en) Contour line generation method, device and equipment
CN107833227B (en) Drawing method and system for circular cutting area
CN105043377B (en) A kind of running route recording method, device and a kind of electronic equipment
CN105824843A (en) Geographic information system map rendering method and device
CN113936265A (en) Parking space automatic identification method based on building general plane positioning diagram
CN108205563B (en) Electronic map information marking method and device and terminal
CN115761725A (en) Axle network superposition method, electronic equipment and storage medium
CN108744520A (en) Determine the method, apparatus and electronic equipment of game model placement position
US20090213121A1 (en) Image processing method and apparatus
CN112434582A (en) Lane line color identification method and system, electronic device and storage medium
CN114581292A (en) Three-dimensional labeling method and device for two-dimensional image

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200420

Address after: 310012 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 102200, No. 8, No., Changsheng Road, Changping District science and Technology Park, Beijing, China. 1-5

Patentee before: AUTONAVI SOFTWARE Co.,Ltd.