A recursive molecular annotation structure generation method for electronic maps

Through the recursive molecular annotation structure generation method, the problem of inefficiency of traditional electronic map annotation methods is solved, and the efficient construction and update of complex structures is realized. It supports rich annotation content and flexible expansion, which improves the visual attractiveness and information volume of the map. .

CN118736066BActive Publication Date: 2025-02-11BEIJING TUZHONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411017284.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-02-11
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

Traditional electronic map annotation methods are inefficient when facing complex and changing maps, and are difficult to meet the needs of actual applications. The existing geographic information software does not directly support the fractional annotation format. Users need to write scripts to implement fractional annotation and the content of the annotation is marked. Not rich enough.

Method used

The recursive molecular annotation structure generation method is adopted. By obtaining the annotation structure units of each part of the molecular annotation structure to be generated, combining and grouping based on the hierarchical value, dynamically calculate the pixel size and drawing range, and supporting multi-molecular annotation and rich annotation of complex structures content.

Benefits of technology

It realizes efficient construction and update of complex annotation structures, supports flexible expansion and dynamic size calculations, and improves the visual appeal and information volume of the map.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736066B_ABST
    Figure CN118736066B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating a recursive molecular annotation structure of an electronic map, comprising obtaining an annotation structure unit (a text unit, a separator unit) corresponding to a molecular annotation structure; determining the grade value of the annotation structure unit based on the score line level; merging and grouping each annotation structure unit according to a set rule from high to low in a recursive manner according to the grade value to obtain a grouping structure unit, and calculating its pixel size, repeating until all are replaced, and obtaining the complete pixel size of the molecular annotation structure; determining the drawing position coordinates on the map, reversing the grouping structure unit to the annotation structure unit and determining the drawing range, repeating until all are restored, and determining the drawing range of each annotation structure unit; and drawing and generating a molecular annotation structure on the map. The present invention can support a multi-molecule annotation structure of a complex structure, has strong expansibility, and supports automatic optimization and adaptive display of the annotation content position, and satisfies the dynamic update of the annotation data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of electronic map annotation, in particular to a method for generating a recursive molecular annotation structure of an electronic map. Background Art

[0002] With the continuous development of geographic information system (GIS) technology, electronic maps, as its core component, have become an indispensable tool for displaying geographic information in modern society. The annotation structure of electronic maps is an important component, which directly affects the readability of maps and the efficiency of information transmission. However, traditional map annotation methods are often inefficient when facing complex and changeable maps, and are difficult to meet the needs of practical applications. The existing technologies mainly have the following disadvantages:

[0003] In existing electronic map annotation systems, fixed annotation templates or preset annotation styles (such as binary and trichotomous) are usually used to generate annotation content. However, this method is often inadequate when faced with complex and changing map annotation formats.

[0004] Geographic information software on the market (such as ArcGIS) does not directly support the format of fraction annotation. This means that users need to write specific scripts or functions to achieve the effect of fraction annotation. At the same time, in order to ensure the beauty and readability of fraction annotation, the length of the separator line needs to be dynamically adjusted according to the actual length of the numerator and denominator, which usually requires the use of string operations and conditional judgment statements in programming. This requires users to have high programming skills, is difficult to get started, and the scripts or functions written are not very adaptable.

[0005] The geographic information software on the market can generally only use text or built-in symbols to annotate content. The annotation content is not rich enough, and the visual appeal and information content of the map are not strong enough.

[0006] Therefore, it is particularly important to develop an efficient, flexible and easy-to-manage technology for generating electronic map annotation structures. Summary of the invention

[0007] In view of the problems existing in the above-mentioned prior art, the present invention provides a method for generating a recursive molecular annotation structure of an electronic map, which can support multi-molecule annotation structures of complex structures, support rich annotation content, and enhance the visual appeal and information content of the map.

[0008] The present invention discloses a method for generating a recursive molecular annotation structure of an electronic map, comprising:

[0009] S1: Obtaining annotation structure units corresponding to various parts of the molecular annotation structure to be generated, including text units corresponding to the text part and separator units corresponding to the separators separating the text parts;

[0010] S2: Determine the grade value of each annotated structural unit based on the score line level of the corresponding part of the annotated structural unit in the molecular annotated structure;

[0011] S3: in descending order of the grade value, recursively merge and group the annotated structural units according to the set rules to obtain grouped structural units to replace the corresponding annotated structural units, and calculate the pixel size of the grouped structural units in the corresponding part of the molecular annotated structure, repeat until all the annotated structural units are replaced, and obtain the complete pixel size of the molecular annotated structure;

[0012] S4: obtaining the annotation points of the map and determining the drawing position coordinates of the molecular annotation structure on the map based on the complete pixel size; then restoring the replaced annotation structure units according to the reverse order of the merged groups and determining the drawing range, repeating until all the grouped structure units are restored, and determining the drawing range of each annotation structure unit;

[0013] S5: Draw and generate a molecular annotation structure on the map based on the determined annotation structure units.

[0014] Furthermore, in the step S1, the separator unit includes: a horizontal separator unit corresponding to the horizontal separator part separating the left and right characters, and a fraction line separator unit corresponding to the fraction line part separating the context characters; wherein the corresponding part of the horizontal separator unit in the molecular annotation structure is not displayed.

[0015] In the step S1, each annotated structural unit is stored in a annotated structural unit list.

[0016] Furthermore, the step S1 specifically includes:

[0017] Split the selected text unit according to the selected splitting method;

[0018] If the upper and lower splits are performed, newly added fraction separator units and text units are obtained, so that a corresponding fractional expression is formed on the numerator notation structure, wherein the numerator of the fractional expression corresponds to the selected text unit, the fraction line corresponds to the newly added fraction separator unit, and the denominator corresponds to the newly added text unit;

[0019] If left-right splitting is performed, newly added horizontal separator units and text units are obtained, so that two corresponding adjacent text parts are formed on the molecular annotation structure, wherein the text parts corresponding to the selected and newly added text units are located on the left and right sides respectively, and the horizontal separator part corresponding to the newly added horizontal separator unit is located between the left and right text units.

[0020] Furthermore, the step S2 comprises:

[0021] The rank values ​​of text cells and horizontal separator cells are determined based on the following expressions respectively:

[0022] level 文字 =2n

[0023] level 水平分隔符 =2n

[0024] The rank value of the fraction line separator cell of the corresponding part of the text cell / horizontal separator cell in the numerator annotation structure is determined based on the following expression:

[0025] level 分数线 =(level 文字 or level 水平分隔符 )-1

[0026] Among them, level 文字 is the level value of the text unit, level 水平分隔符 is the level value of the horizontal separator unit, level 分数线 is the grade value of the fraction separator unit;

[0027] n is a natural number greater than or equal to 0, and is determined based on the score line level number of the corresponding part of the annotated structural unit in the molecular annotated structure. When n=0, it means that the annotated structural unit has no associated score line in the molecular annotated structure, and is naturally not at any score line level, so the level number is 0.

[0028] Furthermore, the step S2 includes: the level value of the selected text unit is determined based on the following expression:

[0029] level 选定 =2n

[0030] Among them, level 选定 is the grade value of the selected text unit, n is a natural number greater than or equal to 0, and is determined based on the score line level of the corresponding part of the annotation structure unit in the molecular annotation structure;

[0031] When the selected text unit is split up and down, change the level value of the selected text unit to level 选定 +2, determine the level value of the newly added fraction separator unit 选定 +1, confirm that the level value of the newly added text unit is the same as the level value of the selected text unit after the change;

[0032] When the selected text unit is split into left and right parts, it is determined that the level value of the newly added horizontal separator unit and text unit is the same as the level value of the selected text unit.

[0033] Furthermore, the step S2 further includes:

[0034] Determine the annotation content binding relationship corresponding to each annotation structure unit, wherein the annotation content binding relationship is used to dynamically obtain the text content of the annotation;

[0035] Determine the order index corresponding to the annotated structural unit according to the order of the grade values ​​corresponding to each part of the molecular annotated structure from high to low, from left to right, and from top to bottom;

[0036] The symbol style definition corresponding to each annotation structure unit is determined, wherein the symbol style definition corresponding to the text unit is a font symbol, and the symbol style definition corresponding to the fraction separator unit is a line symbol.

[0037] Furthermore, the step S3 includes:

[0038] S301: Determine the pixel size of the text unit in the molecular annotation structure based on the annotation content binding relationship of the text unit and the symbol style definition;

[0039] S302: Find the separator unit with the largest level value in the annotation structure unit list, merge and group it with the text unit corresponding to the text part adjacent to the corresponding separator in the molecular annotation structure, and obtain a grouped structure unit;

[0040] S303: Calculate the pixel size of the grouping structure unit;

[0041] S304: replacing the corresponding annotated structural unit in the annotated structural unit list with the obtained grouped structural unit to obtain a new annotated structural unit list as a new search object;

[0042] S305: Repeat steps S302 to S304 until the grouped structural units replace all the annotated structural units, and the calculated pixel size of the grouped structural units is the complete pixel size of the molecular annotated structure.

[0043] Furthermore, the step S302 includes:

[0044] Find the separator unit with the largest level value in the list of labeled structural units;

[0045] If the separator unit is a horizontal separator unit, then the horizontal separator units with the same and continuous level values ​​are found, and the horizontal separator units adjacent to the horizontal separator units are merged and grouped to obtain a grouping structure unit.

[0046] If the separator unit is a fraction separator unit, the found fraction separator unit and its adjacent annotation structure unit are merged and grouped to obtain a grouping structure unit;

[0047] The step S303 includes: for a grouping structure unit obtained by merging and grouping the horizontal separator units, the height of the grouping structure unit is the maximum height of the marked structure units in the grouping structure unit, and the width of the grouping structure unit is the sum of the widths of the marked structure units in the grouping structure unit;

[0048] For the grouping structure unit obtained by merging and grouping the fraction line separator units, its height is the sum of the thickness of each annotation structure unit and the fraction line, and its width is the maximum width of the annotation structure unit.

[0049] Furthermore, the step S303 further includes:

[0050] Determine the relative position of the marked structural unit in the grouping structural unit relative to the upper left corner of the grouping structural unit on the map.

[0051] Furthermore, the step S4 comprises:

[0052] S401: Calculate the pixel coordinates of the marked point on the map by giving the geographical coordinates of the marked point, the display range and scale of the current map;

[0053] S402: Calculate the pixel coordinates of the upper left corner of the molecular annotation structure on the map based on the pixel coordinates of the annotation point, the relative relationship between the annotation point and the molecular formula annotation, and the complete pixel size of the molecular annotation structure;

[0054] S403: then restore the replaced annotation structure unit by grouping the structure units in reverse order of the merged grouping, and determine the drawing range of the restored annotation structure unit based on the relative position of each annotation structure unit in the grouping structure unit relative to the upper left corner of the grouping structure unit and the pixel coordinates of the upper left corner of the grouping structure unit;

[0055] S404: Repeat step S403 until all the grouped structural units are restored, and obtain the drawing range of each labeled structural unit.

[0056] The present invention has at least the following beneficial effects:

[0057] 1. Construction and update of complex annotation structures. Based on the technical idea of ​​infinite hierarchical decomposition of the molecular formula concept, complex and changeable map annotation structures can be decomposed into smaller and more manageable parts (annotation structure units) in a recursive way.

[0058] 2. Flexible expansion of molecular annotation structure. Based on the step-by-step decomposition interactive design with unlimited splits, the existing molecular annotation structure can be expanded horizontally or vertically in any part, and even the existing split expansion strategy can be deleted.

[0059] 3. Dynamic size calculation of molecular annotation structure. The annotation content and the molecular annotation structure are dynamically associated. You only need to define a set of molecular structures and combine the annotation content binding relationship to express annotations with different text contents. At the same time, the drawing range of each molecular structure unit will be dynamically calculated during the drawing process, without the user having to define the range of each component in the molecular annotation structure in advance, which is more convenient and flexible to use.

[0060] Other beneficial effects of the present invention will be described in detail in the specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0062] Figure 1 It is a flow chart of a method for generating a recursive molecular annotation structure of an electronic map disclosed in a preferred embodiment of the present invention.

[0063] Figure 2 This is an example diagram of a molecular annotation structure definition disclosed in a preferred embodiment of the present invention.

[0064] Figure 3 It is a design diagram of the interface of the recursive molecular annotation structure generation function disclosed in the preferred embodiment of the present invention.

[0065] Figure 4 It is a flow chart of newly annotated structural units in the recursive molecular annotation structure disclosed in the preferred embodiment of the present invention.

[0066] Figure 5 It is a flow chart of calculating the overall size of a recursive molecular annotation structure disclosed in a preferred embodiment of the present invention.

[0067] Figure 6 It is a flow chart of the drawing range of each annotated structure unit for calculating the recursive molecular annotated structure disclosed in the preferred embodiment of the present invention. DETAILED DESCRIPTION

[0068] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0069] like Figure 1As shown, the present invention discloses a method for generating a recursive molecular annotation structure of an electronic map, comprising:

[0070] S1: Obtaining annotation structure units corresponding to various parts of the molecular annotation structure to be generated, including text units corresponding to the text part and separator units corresponding to the separators separating the text parts;

[0071] S2: Determine the grade value of each annotated structural unit based on the score line level of the corresponding part of the annotated structural unit in the molecular annotated structure;

[0072] S3: in descending order of the grade value, recursively merge and group the annotated structural units according to the set rules to obtain grouped structural units to replace the corresponding annotated structural units, and calculate the pixel size of the grouped structural units in the corresponding part of the molecular annotated structure, repeat until all the annotated structural units are replaced, and obtain the complete pixel size of the molecular annotated structure;

[0073] S4: obtaining the annotation points of the map and determining the drawing position coordinates of the molecular annotation structure on the map based on the complete pixel size; then restoring the replaced annotation structure units according to the reverse order of the merged groups and determining the drawing range, repeating until all the grouped structure units are restored, and determining the drawing range of each annotation structure unit;

[0074] S5: Draw and generate a molecular annotation structure on the map based on the determined annotation structure units.

[0075] like Figure 2 As shown in the figure, the molecular annotation structure is drawn by a number of annotation structure units. The annotation structure units exist in the form of a list (also called an annotation structure unit list). The annotation structure units mainly include three categories, namely text, horizontal separators (content will not be displayed on the map), and fraction line separators (fraction lines are drawn on the map). Each annotation structure unit corresponds to five parts: sequential index, level value, symbol style definition (text corresponds to font symbols, fraction lines correspond to line symbols), drawing range (need to be calculated later), and annotation content binding relationship.

[0076] The deeper the numerator or denominator level n (starting from 1) where the horizontal separator is located, the greater its level is, and the level value is 2n. The level value of the fraction separator where it is located is 2n-1. Figure 2The level of the annotated structure unit 2 is 2, and the level of the annotated structure unit 4 is 1. The sequential index is arranged in the order of the annotated structure units from high to low, from left to right, and from top to bottom. The annotation content binding relationship is to dynamically obtain the annotated text content. For example, when it is necessary to display certain field contents of a table based on a certain molecular annotation structure on the map, it can be bound to a field of this table, so that different records of this table can be displayed on the map based on a molecular annotation structure. The displayed text supports Chinese and English characters, punctuation marks, or user-defined TrueType characters, as shown in Table 1 below.

[0077] Table 1

[0078]

[0079] TrueType is a new mathematical glyph description technology jointly proposed by Apple and Microsoft. TrueType is a technology that uses mathematical functions to describe the outline of fonts. It includes instructions such as glyph construction, color filling, digital description function, process condition control, grid processing control, and additional prompt control. Based on the combination of text and TrueType fonts, the advanced graphic annotation supports not only text and special characters, but also extended symbols such as tree species symbols and forest species symbols, which improves the visual richness and information content of map annotations.

[0080] See also Figure 4 This embodiment discloses a process of structural expansion based on existing molecular formula annotation - structural unit. Users can perform unlimited hierarchical splitting based on this process. Figure 3 The interface design of the recursive molecular annotation structure generation function is flexible and easy to operate. Specifically, the process of adding annotated structural units by splitting includes:

[0081] Select the annotated structural unit to be cut (assuming its level is 2n);

[0082] Select the split type:

[0083] If horizontal splitting is used, a horizontal separator and a label structure unit are inserted in sequence after selecting the label structure unit, with a level of 2n;

[0084] If vertical splitting is used, the level of the currently selected annotation structure unit is adjusted to 2n+2; after the selected structure unit, a fraction separator unit (level value is 2n+1) and a annotation structure unit (level is 2n+2) are inserted in sequence;

[0085] Rearrange the order of the labeled structural units in the molecular formula from inside to outside, from left to right, and from top to bottom;

[0086] Finish.

[0087] In some preferred embodiments of the present invention, the step S1 specifically includes:

[0088] Split the selected text unit according to the selected splitting method;

[0089] If the upper and lower splits are performed, newly added fraction separator units and text units are obtained, so that a corresponding fractional expression is formed on the numerator notation structure, wherein the numerator of the fractional expression corresponds to the selected text unit, the fraction line corresponds to the newly added fraction separator unit, and the denominator corresponds to the newly added text unit;

[0090] If left-right splitting is performed, newly added horizontal separator units and text units are obtained, so that two corresponding adjacent text parts are formed on the molecular annotation structure, wherein the text parts corresponding to the selected and newly added text units are located on the left and right sides respectively, and the horizontal separator part corresponding to the newly added horizontal separator unit is located between the left and right text units.

[0091] In some preferred embodiments of the present invention, it is specifically disclosed how to determine the grade value of the marked structural unit, including:

[0092] The rank values ​​of text cells and horizontal separator cells are determined based on the following expressions respectively:

[0093] level 文字 =2n

[0094] level 水平分隔符 =2n

[0095] The rank value of the fraction line separator cell of the corresponding part of the text cell / horizontal separator cell in the numerator annotation structure is determined based on the following expression:

[0096] level 分数线 =(level 文字 or level 水平分隔符 )-1

[0097] Among them, level 文字 is the level value of the text unit, level 水平分隔符 is the level value of the horizontal separator unit, level 分数线 is the grade value of the fraction separator unit;

[0098] n is a natural number greater than or equal to 0, and is determined based on the score line level number of the corresponding part of the annotated structural unit in the molecular annotated structure. When n=0, it means that the annotated structural unit has no associated score line in the molecular annotated structure, and is naturally not at any score line level, so the level number is 0.

[0099] For example, Figure 2 In the numerator notation structure shown, A and B are the numerators of the fraction line, and C and D are the denominators of the fraction line. Since A, B, C, and D are only related to this one fraction line, the level numbers corresponding to A, B, C, and D are all 1, that is, n=1, and their level values ​​are 2n=2; the level value of this fraction line is 2n-1=1; since part E is not the numerator or denominator of any fraction line, its fraction line level is 0, that is, n=0, and its level value is 2n=0.

[0100] In some preferred embodiments of the present invention, for the splitting of the text unit disclosed in the above embodiment, how to determine the level value subsequently is specifically disclosed, specifically including: the level value of the selected text unit is determined based on the following expression:

[0101] level 选定 =2n

[0102] Among them, level 选定 is the grade value of the selected text unit, n is a natural number greater than or equal to 0, and is determined based on the score line level of the corresponding part of the annotation structure unit in the molecular annotation structure;

[0103] When the selected text unit is split up and down, change the level value of the selected text unit to level 选定 +2, determine the level value of the newly added fraction separator unit 选定 +1, confirm that the level value of the newly added text unit is the same as the level value of the selected text unit after the change;

[0104] When the selected text unit is split into left and right parts, it is determined that the level value of the newly added horizontal separator unit and text unit is the same as the level value of the selected text unit.

[0105] In some preferred embodiments of the present invention, the step S2 further includes:

[0106] Determine the annotation content binding relationship corresponding to each annotation structure unit, wherein the annotation content binding relationship is used to dynamically obtain the text content of the annotation;

[0107] Determine the order index corresponding to the annotated structural unit according to the order of the grade values ​​corresponding to each part of the molecular annotated structure from high to low, from left to right, and from top to bottom;

[0108] The symbol style definition corresponding to each annotation structure unit is determined, wherein the symbol style definition corresponding to the text unit is a font symbol, and the symbol style definition corresponding to the fraction separator unit is a line symbol.

[0109] See also Figure 5 The process of calculating the overall size (pixel size on the map) of the recursive molecular annotation structure shown in the figure specifically includes:

[0110] Start (labeling structural units for already constructed molecules);

[0111] Combine ① font style settings, screen DPI, fraction line style, alignment, etc., and ② annotated text to calculate the size of each text, that is, the pixel size drawn on the map (origin unknown);

[0112] Search for all level=m (max, maximum value) separators in the annotated structural unit list to determine whether they exist; if not, directly proceed to the m=m-1 stage below;

[0113] If it exists, determine whether it is a horizontal separator;

[0114] If so, find the same-level and continuous horizontal separators and their adjacent annotation structure units (i.e., the left and right parts of the separators);

[0115] Set the grouping structure unit and record it as follows:

[0116] (1) The height of the record group = the maximum height of each marked structural unit;

[0117] (2) The width of the record group = the sum of the widths of each structural unit;

[0118] (3) Record the relative position of each labeled structural unit relative to the upper left corner of this group.

[0119] If not, then find the adjacent structural units (i.e., the upper and lower parts of the score line);

[0120] Set the grouping structure unit and record it as follows:

[0121] (1) Record the height of the group = the sum of the heights of the marked structural units + the thickness of the score line;

[0122] (2) The width of the record group = the maximum width of the annotation structure unit;

[0123] (3) Record the length of the score line as the width of the group;

[0124] (4) Record the relative positions of the context word and score line relative to the upper left corner of this group.

[0125] After completing the recording, in the annotated structural unit list, use the grouped structural unit to replace the structural unit in the group, and create a new annotated structural unit list as a new search object;

[0126] Set m=m-1 to get a new m value, i.e., a new search target value;

[0127] Determine whether m is greater than or equal to 0. If so, return to search for the delimiter again; if not, obtain the pixel size of the entire molecular annotation structure and the calculation ends.

[0128] In some preferred embodiments of the present invention, the step S3 comprises:

[0129] S301: Determine the pixel size of the text unit in the molecular annotation structure based on the annotation content binding relationship of the text unit and the symbol style definition;

[0130] S302: Find the separator unit with the largest level value in the annotation structure unit list, merge and group it with the text unit corresponding to the text part adjacent to the corresponding separator in the molecular annotation structure, and obtain a grouped structure unit;

[0131] S303: Calculate the pixel size of the grouping structure unit;

[0132] S304: replacing the corresponding annotated structural unit in the annotated structural unit list with the obtained grouped structural unit to obtain a new annotated structural unit list as a new search object;

[0133] S305: Repeat steps S302 to S304 until the grouped structural units replace all the annotated structural units, and the calculated pixel size of the grouped structural units is the complete pixel size of the molecular annotated structure.

[0134] Furthermore, the step S302 includes:

[0135] Find the separator unit with the largest level value in the list of labeled structural units;

[0136] If the separator unit is a horizontal separator unit, then the horizontal separator units with the same and continuous level values ​​are found, and the horizontal separator units adjacent to the horizontal separator units are merged and grouped to obtain a grouping structure unit.

[0137] If the separator unit is a fraction separator unit, the found fraction separator unit and its adjacent annotation structure unit are merged and grouped to obtain a grouping structure unit;

[0138] The step S303 includes: for a grouping structure unit obtained by merging and grouping the horizontal separator units, the height of the grouping structure unit is the maximum height of the marked structure units in the grouping structure unit, and the width of the grouping structure unit is the sum of the widths of the marked structure units in the grouping structure unit;

[0139] For the grouping structure unit obtained by merging and grouping the fraction line separator units, its height is the sum of the thickness of each annotation structure unit and the fraction line, and its width is the maximum width of the annotation structure unit.

[0140] Furthermore, the step S303 further includes:

[0141] Determine the relative position of the marked structural unit in the grouping structural unit relative to the upper left corner of the grouping structural unit on the map.

[0142] See also Figure 6 The process of calculating the drawing range of each annotation structure unit shown includes:

[0143] The pixel position of the upper left corner of the entire annotation on the map;

[0144] Search the remaining newly constructed structural unit list in reverse order according to the generation time sequence;

[0145] Determine whether it exists. If it does, find each grouping structure unit, and calculate the drawing pixel range of each structure unit in the group based on the relative position of each structure unit in the group relative to the group; return;

[0146] If it does not exist, then get the drawing pixel range of each text structure unit and fraction line;

[0147] Draw each text structure unit and score line on the map;

[0148] Finish.

[0149] In some preferred embodiments of the present invention, the step S4 comprises:

[0150] S401: Calculate the pixel coordinates of the marked point on the map by giving the geographical coordinates of the marked point, the display range and scale of the current map;

[0151] S402: Calculate the pixel coordinates of the upper left corner of the molecular annotation structure on the map based on the pixel coordinates of the annotation point, the relative relationship between the annotation point and the molecular formula annotation (such as the center of the molecular formula annotation is consistent with the annotation point), and the complete pixel size of the molecular annotation structure;

[0152] S403: then restore the replaced annotation structure unit by grouping the structure units in reverse order of the merged grouping, and determine the drawing range of the restored annotation structure unit based on the relative position of each annotation structure unit in the grouping structure unit relative to the upper left corner of the grouping structure unit and the pixel coordinates of the upper left corner of the grouping structure unit;

[0153] S404: Repeat step S403 until all the grouped structural units are restored, and obtain the drawing range of each labeled structural unit.

[0154] The step S5 specifically includes: based on the drawing style definition and drawing range of each text and score line, drawing and presenting them on the map.

[0155] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for generating a recursive molecular annotation structure of an electronic map, characterized in that: include: S1: Obtaining annotation structure units corresponding to various parts of the molecular annotation structure to be generated, including text units corresponding to the text part and separator units corresponding to the separators separating the text parts; S2: Determine the grade value of each annotated structural unit based on the score line level of the corresponding part of the annotated structural unit in the molecular annotated structure; S3: in descending order of the grade value, recursively merge and group the annotated structural units according to the set rules to obtain grouped structural units to replace the corresponding annotated structural units, and calculate the pixel size of the grouped structural units in the corresponding part of the molecular annotated structure, repeat until all the annotated structural units are replaced, and obtain the complete pixel size of the molecular annotated structure; S4: obtaining the annotation points of the map and determining the drawing position coordinates of the molecular annotation structure on the map based on the complete pixel size; then restoring the replaced annotation structure units according to the reverse order of the merged groups and determining the drawing range, repeating until all the grouped structure units are restored, and determining the drawing range of each annotation structure unit; S5: Draw and generate a molecular annotation structure on the map based on the determined annotation structure units; Wherein, in the step S1, each annotated structural unit is stored in an annotated structural unit list; The step S3 comprises: S301: Determine the pixel size of the text unit in the molecular annotation structure based on the annotation content binding relationship of the text unit and the symbol style definition; S302: Find the separator unit with the largest level value in the annotation structure unit list, merge and group it with the text unit corresponding to the text part adjacent to the corresponding separator in the molecular annotation structure, and obtain a grouped structure unit; S303: Calculate the pixel size of the grouping structure unit; determine the relative position of the marked structure unit in the grouping structure unit relative to the upper left corner of the grouping structure unit on the map; S304: replacing the corresponding annotated structural unit in the annotated structural unit list with the obtained grouped structural unit to obtain a new annotated structural unit list as a new search object; S305: repeating steps S302 to S304 until the grouped structural units replace all the annotated structural units, and the calculated pixel size of the grouped structural units is the complete pixel size of the molecular annotated structure; In the step S4, the grouping structural units are then restored to the replaced annotation structural units in the reverse order of the merged groups and the drawing range is determined, and this is repeated until all the grouping structural units are restored to determine the drawing range of each annotation structural unit, including: Then, the grouped structural units are restored to the replaced annotation structural units in the reverse order of the merged groups, and the drawing range of the restored annotation structural units is determined based on the relative positions of each annotation structural unit in the grouped structural unit relative to the upper left corner of the grouped structural unit and in combination with the pixel coordinates of the upper left corner of the grouped structural unit; this process is repeated until all the grouped structural units are restored, and the drawing range of each annotation structural unit is obtained.

2. The method for generating a recursive molecular annotation structure of an electronic map according to claim 1, characterized in that: In the step S1, the separator unit includes: a horizontal separator unit corresponding to the horizontal separator part separating the left and right characters, and a fraction line separator unit corresponding to the fraction line part separating the context characters; wherein the corresponding part of the horizontal separator unit in the molecular annotation structure is not displayed.

3. The method for generating a recursive molecular annotation structure of an electronic map according to claim 2, characterized in that: The step S1 specifically includes: Split the selected text unit according to the selected splitting method; If the upper and lower splits are performed, newly added fraction separator units and text units are obtained, so that a corresponding fractional expression is formed on the numerator notation structure, wherein the numerator of the fractional expression corresponds to the selected text unit, the fraction line corresponds to the newly added fraction separator unit, and the denominator corresponds to the newly added text unit; If left-right splitting is performed, newly added horizontal separator units and text units are obtained, so that two corresponding adjacent text parts are formed on the molecular annotation structure, wherein the text parts corresponding to the selected and newly added text units are located on the left and right sides respectively, and the horizontal separator part corresponding to the newly added horizontal separator unit is located between the left and right text units.

4. The method for generating a recursive molecular annotation structure of an electronic map according to claim 2, characterized in that: The step S2 comprises: The rank values ​​of text cells and horizontal separator cells are determined based on the following expressions respectively: <h2 style=";text-align:left;direction:ltr">level<h2 style=";text-align:left;direction:ltr"> 文字 <h2 style=";text-align:left;direction:ltr"> =2n <h2 style=";text-align:left;direction:ltr">level<h2 style=";text-align:left;direction:ltr"> 水平分隔符 <h2 style=";text-align:left;direction:ltr"> =2n The rank value of the fraction line separator cell of the corresponding part of the text cell or horizontal separator cell in the numerator annotation structure is determined based on the following expression: level 分数线 =(level 文字 or level 水平分隔符 ) - 1 Among them, level 文字 is the level value of the text unit, level 水平分隔符 is the level value of the horizontal separator unit, level 分数线 is the grade value of the fraction separator unit; n is a natural number greater than or equal to 0, and is determined based on the score line level number of the corresponding part of the annotated structural unit in the molecular annotated structure.

5. The method for generating a recursive molecular annotation structure of an electronic map according to claim 3, characterized in that: The step S2 comprises: determining the level value of the selected text unit based on the following expression: <h2 style=";text-align:left;direction:ltr">level<h2 style=";text-align:left;direction:ltr"> 选定 <h2 style=";text-align:left;direction:ltr"> =2n Among them, level 选定 is the grade value of the selected text unit, n is a natural number greater than or equal to 0, and is determined based on the score line level of the corresponding part of the annotation structure unit in the molecular annotation structure; When the selected text unit is split up and down, change the level value of the selected text unit to level 选定 +2, determine the level value of the newly added fraction separator unit 选定 +1, confirm that the level value of the newly added text unit is the same as the level value of the selected text unit after the change; When the selected text unit is split into left and right parts, it is determined that the level value of the newly added horizontal separator unit and text unit is the same as the level value of the selected text unit.

6. The method for generating electronic map recursive molecular annotation structures according to claim 5, characterized in that: The step S2 further includes: Determine the annotation content binding relationship corresponding to each annotation structure unit, wherein the annotation content binding relationship is used to dynamically obtain the text content of the annotation; Determine the order index corresponding to the annotated structural unit according to the order of the grade values ​​corresponding to each part of the molecular annotated structure from high to low, from left to right, and from top to bottom; The symbol style definition corresponding to each annotation structure unit is determined, wherein the symbol style definition corresponding to the text unit is a font symbol, and the symbol style definition corresponding to the fraction separator unit is a line symbol.

7. The method for generating electronic map recursive molecular annotation structures according to claim 6, characterized in that: The step S302 includes: Find the separator unit with the largest level value in the list of labeled structural units; If the separator unit is a horizontal separator unit, then the horizontal separator units with the same and continuous level values ​​are found, and the horizontal separator units adjacent to the horizontal separator units are merged and grouped to obtain a grouping structure unit. If the separator unit is a fraction separator unit, the found fraction separator unit and its adjacent annotation structure unit are merged and grouped to obtain a grouping structure unit; The step S303 includes: For a grouping structure unit obtained by merging and grouping horizontal separator units, its height is the maximum height of the annotated structure units in the grouping structure unit, and its width is the sum of the widths of the annotated structure units in the grouping structure unit; For the grouping structure unit obtained by merging and grouping the fraction line separator units, its height is the sum of the thickness of each annotation structure unit and the fraction line, and its width is the maximum width of the annotation structure unit.

8. The method for generating electronic map recursive molecular annotation structures according to claim 7, characterized in that: In the step S4, the step of obtaining the map annotation points and determining the drawing position coordinates of the molecular annotation structure on the map based on the complete pixel size includes: S401: Calculate the pixel coordinates of the marked point on the map by giving the geographical coordinates of the marked point, the display range and scale of the current map; S402: Calculate the pixel coordinates of the upper left corner of the molecular annotation structure on the map based on the pixel coordinates of the annotation point, the relative relationship between the annotation point and the molecular formula annotation, and the complete pixel size of the molecular annotation structure.

Citation Information

Patent Citations

  • Method and device for drawing molecular formula annotation on electronic map

    CN108509570A

  • Configuration method and device for combined notes in electronic map

    CN111833415A