Map sign avoidance method and device, electronic equipment and computer readable storage medium
By generating grid bitmaps and cluster groups, and combining the distance and density between the cluster center and the center of the viewport map to determine the priority of signs, the problem of overlapping signs or labels when zooming in on the map is solved, resulting in better visualization and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2026-03-27
AI Technical Summary
When the map is zoomed or adjusted, overlapping signs or labels can prevent the map from being fully displayed on the screen, affecting the map's visualization and user experience.
By generating a grid bitmap and multiple cluster groups, the occupancy status and spatial distribution relationship of labels and signs are clarified. The priority of cluster groups is determined by combining the distance between the cluster center and the center of the viewport map and the cluster density. The priority of signs is determined based on the position of the labels, and the best position is assigned to the signs within a local area.
This effectively avoids overlapping signs or labels, improving the map's visualization and user experience.
Smart Images

Figure CN120743410B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer graphics, and in particular, to a map label avoidance method and device, an electronic device, and a computer readable storage medium. BACKGROUND
[0002] With the continuous enrichment of informationized map system data, the information marked on the map presents a continuous enhancement trend. When the map is zoomed or adjusted, the size of the labels in the map does not scale with the map size, which can cause label or mark overlap, and a large number of label or mark overlaps will result in the screen range being unable to fully display, seriously affecting the visual display effect of the map and the user experience. SUMMARY
[0003] In view of this, the purpose of the present application is to provide a map label avoidance method, device, electronic device, and computer readable storage medium, which can effectively avoid label or label overlap.
[0004] To achieve the above purpose, the technical solutions adopted by the embodiments of the present application are as follows:
[0005] In a first aspect, the present application provides a map label avoidance method, which comprises:
[0006] generating a grid bitmap and a plurality of clustering groups according to the current view window map; the grid bitmap is used to mark the situation that the grid map corresponding to the current view window map is occupied by the labels and labels in the current view window map; each of the clustering groups contains labels and labels that do not overlap with each other; the labels correspond one-to-one to the labels;
[0007] determining the priority of each of the clustering groups according to the distance between the clustering center of each of the clustering groups and the center of the current view window map, and the clustering density of the clustering group; the clustering density is determined according to the number of labels in the clustering group;
[0008] determining the priority of the labels in each of the clustering groups according to the position of the labels in each of the clustering groups;
[0009] determining each of the labels as a to-be-processed label in turn according to the priority of the clustering groups and the priority of the labels in the clustering groups;
[0010] determining the candidate position of the to-be-processed label according to the position of the mark point corresponding to the to-be-processed label; the candidate position is a grid in the grid map corresponding to the current view window map within a preset range centered on the mark point corresponding to the to-be-processed label;
[0011] determining a priority coefficient of each of the candidate positions according to a priority of a cluster group in which the to-be-processed sign is located, the candidate positions of the to-be-processed sign, positions of the labels corresponding to the to-be-processed sign, and positions of other signs in the cluster group in which the to-be-processed sign is located;
[0012] determining the position of the to-be-processed sign according to the candidate positions of the to-be-processed sign, the priority coefficients of the candidate positions, and the grid bitmap, and updating the grid bitmap according to the position of the to-be-processed sign.
[0013] In an optional implementation, the generating the grid bitmap and the plurality of cluster groups according to the current window map comprises:
[0014] generating an initial grid bitmap corresponding to the current window map according to a size of the current window map and a preset grid size, wherein each grid in the initial grid bitmap is not occupied;
[0015] setting an occupation state of a grid in which each label in the initial grid bitmap is located as occupied to obtain the grid bitmap;
[0016] performing clustering on the labels and the signs in the current window map according to a spatial distribution of the labels and a preset clustering threshold to obtain the plurality of cluster groups.
[0017] In an optional implementation, the sequentially determining each of the signs as a to-be-processed sign according to the priority of the cluster group and the priority of the sign in the cluster group comprises:
[0018] sequentially determining each of the cluster groups as a to-be-processed cluster group according to a high-low order of the priority of the cluster group;
[0019] sequentially determining each of the signs in the to-be-processed cluster group as a to-be-processed sign according to a high-low order of the priority of each of the signs in the to-be-processed cluster group, wherein the priority of the sign is determined according to a distance between a cluster center of the cluster group in which the sign is located and a position of a label corresponding to the sign.
[0020] In an optional implementation, the determining the position of the to-be-processed sign according to the candidate positions of the to-be-processed sign, the priority coefficients of the candidate positions, and the grid bitmap, and updating the grid bitmap according to the position of the to-be-processed sign comprises:
[0021] solving a greedy target function according to the candidate positions of the to-be-processed sign, the priority coefficients of the candidate positions, and the grid bitmap to obtain the position of the to-be-processed sign;
[0022] setting an occupation state of a grid in which the to-be-processed sign is located in the grid bitmap as occupied.
[0023] In an optional embodiment, the calculation formula of the priority coefficient is:
[0024]
[0025] wherein P i is the priority coefficient of the sign i at the candidate position p; Importance i is the importance coefficient of the sign i corresponding to the label; a is the repulsion weight; b is the attraction weight, which is positively correlated with the importance coefficient of the label; g is the clustering priority weight; is the distance between the candidate position p corresponding to the sign i and the label corresponding to the sign i; is the distance between the candidate position p corresponding to the sign i and other signs j; C k is the cluster group in which the sign i is located; ClusterPriority(C k ) is the priority of the cluster group C k .
[0026] In an optional embodiment, the greedy objective function is:
[0027]
[0028] wherein, is the position of the sign i; Candidates i is the candidate position of the sign i; P i (p) is the priority coefficient of the sign i at the candidate position p; G is the grid bitmap; ∏(·) is the continuous multiplication function; Area(p) is the grid corresponding to the candidate position p occupied by the sign i.
[0029] In an optional embodiment, after the position of the sign to be processed is determined according to the candidate position of the sign to be processed, the priority coefficient of the candidate position, and the grid bitmap, and the grid bitmap is updated according to the position of the sign to be processed, the method further comprises:
[0030] drawing a sign icon on the interface of the current window map according to the position of each sign to be processed, and inputting the display information of the sign to be processed into the corresponding sign icon;
[0031] drawing a connection line between the sign icon and the corresponding label icon of each sign to be processed on the interface of the current window map.
[0032] In a second aspect, the present application provides a map sign avoidance device, which comprises:
[0033] The dividing module is configured to generate a grid bitmap and a plurality of cluster groups according to a current view map; the grid bitmap is used to mark a situation in which a grid map corresponding to the current view map is occupied by labels and signs in the current view map; each of the cluster groups comprises non-overlapping labels and signs; the labels and the signs are in one-to-one correspondence;
[0034] The determining module is configured to determine a priority of each of the cluster groups according to a distance between a cluster center of each of the cluster groups and a center of the current view map, and a cluster density of each of the cluster groups; the cluster density is determined according to a number of labels in each of the cluster groups; determine a priority of the signs in each of the cluster groups according to positions of the labels in each of the cluster groups; determine each of the signs as a to-be-processed sign in sequence according to the priority of each of the cluster groups and the priority of the signs in each of the cluster groups; determine a candidate position of the to-be-processed sign according to a position of a mark point corresponding to the to-be-processed sign; the candidate position is a grid in a preset range of the grid map corresponding to the current view map and centered on the mark point corresponding to the to-be-processed sign; determine a priority coefficient of each of the candidate positions according to the priority of the cluster group in which the to-be-processed sign is located, the candidate position in which the to-be-processed sign is located, the position of the label corresponding to the to-be-processed sign, and positions of the signs in the cluster group in which the to-be-processed sign is located.
[0035] The processing module is configured to determine a position of the to-be-processed sign according to the candidate position of the to-be-processed sign, the priority coefficient of the candidate position, and the grid bitmap, and update the grid bitmap according to the position of the to-be-processed sign.
[0036] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, the memory stores a computer program capable of being executed by the processor, and the processor can execute the computer program to implement the map sign avoidance method according to any one of the preceding embodiments.
[0037] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the map sign avoidance method according to any one of the preceding embodiments.
[0038] Compared with the prior art, the map label avoidance method, device, electronic equipment and computer readable storage medium provided by the embodiment of the present application can clearly mark the occupation state and spatial distribution relationship of labels and labels by generating a grid bitmap and a plurality of cluster groups according to the current view window map, wherein the grid bitmap is used to mark the occupation of the grid map, and each cluster group contains non-overlapping labels and labels. Based on this, the cluster group priority is determined in combination with the distance between the cluster center and the center of the view window map and the cluster density, and the label priority is determined according to the label position, so that the label to be processed is selected in turn according to the priority order.
[0039] The candidate position is determined in the grid within the preset range with the mark point corresponding to the label to be processed as the center, and the priority coefficient is calculated by comprehensively considering the cluster group priority, the candidate position, the label position and the positions of other labels in the same cluster group. Finally, the best position of the label is determined in combination with the grid bitmap and the grid bitmap is updated. Through the marking function and priority mechanism of the grid bitmap, the best position is allocated for the label in a local range, effectively avoiding the overlapping phenomenon of labels or labels, and improving the visual display effect and user experience of the map.
[0040] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0042] Figure 1 A flowchart of the map label avoidance method provided by the embodiment of the present application is shown.
[0043] Figure 2 Another flowchart of the map label avoidance method provided by the embodiment of the present application is shown.
[0044] Figure 3 A schematic diagram of the map label avoidance display provided by the embodiment of the present application is shown.
[0045] Figure 4 A block diagram of the map label avoidance device provided by the embodiment of the present application is shown.
[0046] Figure 5 A block diagram of the electronic equipment provided by the embodiment of the present application is shown.
[0047] Icon: 200 - map icon avoidance device; 201 - division module; 202 - determination module; 203 - processing module; 300 - electronic device; 310 - memory; 320 - processor; 330 - communication module. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations.
[0049] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0050] It should be noted that the relational terms such as "first" and "second" and the like are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0051] With the continuous enrichment of informationized map system data, the amount of data identified on the map has increased significantly. These identifications provide basic information and attributes of the target. In daily use scenarios, due to the failure to achieve dynamic avoidance function, the system interface display is chaotic, complex, and the visualization effect is poor. Therefore, it is urgent to develop an intelligent sign avoidance technology to optimize the visualization display effect and improve user experience.
[0052] The inventor has found that existing label avoidance research mainly focuses on static target label avoidance. When a map is initially displayed, each label is not overlapped in geographical position. However, when the scale of the map displayed is changed, the size of the label will not be scaled with the scale, so that the label is overlapped or covered. The coordinates of the label displayed in a small scale range are converted into screen coordinates, and the screen coordinates may be overlapped, so that the actual position of the label cannot be determined, and a large amount of target label content is stacked, so that the screen range cannot be fully displayed.
[0053] Research on dynamic target label avoidance is basically limited to a few specific fields. Among them, the idea of label avoidance based on force directed is from physics, and objects are regarded as particles. Particles of the same kind repel each other, and particles of different kinds attract each other. Through this method, labels can repel each other, so as to avoid label overlap. However, this method is only applicable to static scenes in a fixed screen range, and has not been analyzed in combination with real-time updating of dynamic targets.
[0054] In addition, some research proposes a grid method based on multi-weighted force (MWF). The algorithm divides the label periphery into a plurality of grids, and assigns a weight to each grid. Then, the best position of the label is determined through a search algorithm. The advantage of this method is that the label can be uniformly optimized and arranged according to the avoidance priority specified in the international standard by adjusting the weight. However, since the entire screen needs to be divided into grids, and all grids of the entire map need to be traversed and calculated, the calculation amount is large, which may affect the real-time performance of the system.
[0055] In China, some scholars have also studied label avoidance algorithms and proposed some improvement schemes. For example, a grid method is used to divide the display interface into grids, and whether the labels overlap is detected by judging whether the labels occupy the same grid. In addition, a bounding box technology is used to quickly detect and solve the label avoidance problem. Although these methods reduce the calculation overhead to some extent, the display priority of each display element is not fully considered.
[0056] Therefore, the embodiment of the present application provides a map label avoidance method, device, electronic equipment and computer readable storage medium. The method can determine the occupation state and spatial distribution relationship of labels and labels by generating a grid bitmap and a plurality of cluster groups according to a current view window map, wherein the grid bitmap is used to mark the occupation of the grid map, and each cluster group contains labels and labels that do not overlap. Based on this, the cluster group priority is determined in combination with the distance between the cluster center and the center of the view window map and the cluster density, and the label priority is determined according to the label position, so as to select the label to be processed in turn according to the priority order.
[0057] The candidate position is determined in the grid within a preset range with the punctuation corresponding to the label to be processed as the center, and a priority coefficient is calculated by comprehensively considering the cluster group priority, the candidate position, the label position and other label positions in the same cluster group. Finally, the best position of the label is determined in combination with the grid bitmap and the grid bitmap is updated. Through the marking function and the priority mechanism of the grid bitmap, the best position is allocated for the label in a local range, and the phenomenon of label or label overlapping is effectively avoided, thereby improving the visual display effect of the map and the user experience.
[0058] The embodiments of the present application will be described in detail below with reference to the drawings.
[0059] Please refer to Figure 1 , Figure 1 A flowchart of a map label avoidance method provided by an embodiment of the present application is shown. The method comprises the following steps:
[0060] In step S10, a grid bitmap and a plurality of cluster groups are generated according to a current view window map. The grid bitmap is used to mark the situation that the grid map corresponding to the current view window map is occupied by the labels and the labels in the current view window map. Each cluster group contains labels and labels that do not overlap with each other. The labels and the labels are in one-to-one correspondence.
[0061] In the embodiment of the present application, the grid bitmap is used to mark which grids in the grid map corresponding to the current view window map have been occupied by the labels or the labels, and which grids are still in the idle state. Through the grid bitmap, not only can the spatial occupation situation of the current view window map be clearly reflected, but also an important reference basis can be provided for subsequent label position allocation.
[0062] In the embodiment of the present application, there is a one-to-one correspondence between the labels and the labels, which means that each label must be and can only be associated with one label. All labels are grouped to obtain a plurality of cluster groups. Each cluster group contains a plurality of labels and corresponding labels, and the same label and label will not be divided into different cluster groups.
[0063] It can be understood that the generation of the grid bitmap and the cluster group is complementary, and together constitutes the core data structure basis of the map label avoidance method. The grid bitmap provides global spatial occupation information, and the cluster group reasonably divides the labels and the labels from a local perspective. Through the grid bitmap and the cluster group, not only the preliminary organization of the labels and the labels is realized, but also a solid data foundation is laid for subsequent priority calculation and label position allocation.
[0064] In step S20, the priority of each cluster group is determined according to the distance between the cluster center of each cluster group and the center of the current view window map, and the cluster density of the cluster group. The cluster density is determined according to the number of labels in the cluster group.
[0065] Step S30, the priority of the label in each cluster group is determined according to the position of the label in the cluster group.
[0066] In the embodiments of the present application, the priority of the cluster group is affected by two factors, one is the distance between the cluster group center and the current view window map center, which reflects the relative importance of the cluster group in the spatial distribution of the map. The second is the cluster density of the cluster group, which reflects the information density degree of the cluster group.
[0067] It should be understood that the priority of the cluster group is inversely proportional to the distance between the cluster center and the current view window map center, the closer the cluster group is to the map center, the higher the priority, because the map center is usually the focus area of the user's attention, which helps to ensure that the labels near the map center area can be given priority to a reasonable position allocation. The priority of the cluster group is proportional to the cluster density of the cluster group, the more information (i.e. label) dense the cluster group, the higher the priority, because these areas may contain more key information useful to the user.
[0068] The formula for calculating the priority of the cluster group is:
[0069]
[0070] Wherein, ClusterPriority(C k ) is the priority of the cluster group C k , ‖C k ‖ is the cluster density of the cluster group c k , ‖C‖ max is the maximum value of the cluster density corresponding to all cluster groups, U k is the center coordinate of the cluster C k , and M p is defined as the center coordinate of the current view window map, which is updated in real time according to the current view window range.
[0071] Further, the priority of the label in each cluster group is determined according to the specific position of the corresponding label. That is, the priority of the label is a weight value measured based on the distance between the corresponding label and the cluster center of the cluster group.
[0072] In calculating the priority of the label, the distance between the label and the cluster center is quantified, and the distance is taken as the main basis for the priority ranking of the label. For example, if a label is closer to the cluster center, the corresponding label will be considered to have a higher priority, which means that in the subsequent label position allocation process, the label is more likely to be given priority and allocated to a suitable position.
[0073] It should be noted that the step S20 and the step S30 can be executed in series or in parallel, and there is no prior and posterior logical dependency between the step S20 and the step S30.
[0074] In the step S40, each label is determined as a label to be processed in sequence according to the priority of the cluster group and the priority of the label in the cluster group.
[0075] In the embodiments of the present application, the priorities of the cluster group and the label are sorted in multiple levels, and the ordered processing logic from the global to the local is realized. It should be understood that each label is determined as a label to be processed according to the ordered processing logic, and the label to be processed refers to the label object which needs to be calculated for the position at the current stage. This design not only can effectively reduce the possibility of conflict between labels, but also can realize a better visualization effect in a limited screen space.
[0076] In the step S50, a candidate position of the label to be processed is determined according to the position of the mark point corresponding to the label to be processed; the candidate position is a grid in a preset range centered on the mark point corresponding to the label to be processed in the grid map corresponding to the current window map.
[0077] In the embodiments of the present application, the position of the mark point corresponding to the label to be processed needs to be determined, and the position of the mark point is usually converted from the spatial coordinates (i.e. the latitude and longitude coordinates) of the label corresponding to the label to be processed. After a certain calculation or mapping operation, it can be converted into the pixel coordinates in the current window map.
[0078] As a possible implementation manner, the generation manner of the candidate position adopts a spiral search strategy. Specifically, starting from the position of the mark point corresponding to the label to be processed, the spiral path is gradually expanded outward, covering the grid region around the mark point which meets the preset range. That is, the position of the label corresponding to the label to be processed is taken as the center, and the spiral search is performed on the grid map corresponding to the current window map within the preset range, and the grid overlapping with the spiral path is determined as the candidate position. This spiral search manner can ensure that the generation order of the candidate position conforms to a certain logical rule, and the grid close to the mark point is given priority, and gradually expanded to the periphery.
[0079] Suppose that the preset range is 3 layers of grids around the mark point, which means that the candidate position not only includes the grid adjacent to the mark point, but also covers the grid of the next layer and the second layer, thereby providing greater flexibility for the label position allocation. It can be understood that the process of generating the candidate position of the label to be processed by the spiral search not only considers the spatial proximity between the label and the mark point, but also takes into account the calculation efficiency and robustness of the algorithm. This design ensures that the selection range of the candidate position is neither too narrow nor too wide, thereby providing reasonable and feasible options for subsequent label position allocation.
[0080] Step S60, determining the priority coefficient of each candidate position according to the priority of the cluster group where the to-be-processed label is located, the candidate position where the to-be-processed label is located, the position of the label corresponding to the to-be-processed label, and the positions of other labels in the cluster group where the to-be-processed label is located.
[0081] In the embodiment of the present application, the priority coefficient is a weight value for measuring the degree of priority of the candidate position, which can be determined according to the priority of the cluster group where the to-be-processed label is located, the candidate position where the to-be-processed label is located, the position of the label corresponding to the to-be-processed label, and the positions of other labels in the cluster group where the to-be-processed label is located. Through comprehensive analysis of multiple dimensions of data, accurate calculation of the priority coefficient of the candidate position is realized. This multi-factor fusion design not only effectively reduces the possibility of conflict between labels, but also realizes better visualization effect in a limited screen space.
[0082] Step S70, determining the position of the to-be-processed label according to the candidate position of the to-be-processed label, the priority coefficient of the candidate position, and the grid bitmap, and updating the grid bitmap according to the position of the to-be-processed label.
[0083] In the embodiment of the present application, first, the unoccupied candidate position is screened out from the candidate positions of the to-be-processed label according to the current grid bitmap. Then, the candidate position with the highest priority coefficient in the unoccupied candidate positions is determined as the position of the to-be-processed label. It should be pointed out that once the position of the to-be-processed label is determined, the grid bitmap is immediately updated using the position of the to-be-processed label, providing the latest reference information for subsequent label position allocation.
[0084] In summary, the map label avoidance method provided in the embodiment of the present application can clearly determine the occupation state and spatial distribution relationship of labels and labels by generating a grid bitmap and multiple cluster groups according to the current window map, wherein the grid bitmap is used to mark the occupation state of the grid map, and each cluster group contains labels and labels that do not overlap with each other. Based on this, the cluster group priority is determined in combination with the distance between the cluster center and the window map center and the cluster density, and the label priority is determined according to the label position, so that the to-be-processed label is selected in order according to the priority. The candidate position is determined in the grid within a preset range with the label corresponding to the to-be-processed label as the center, the priority coefficient is calculated by comprehensively considering the cluster group priority, the candidate position, the label position, and the positions of other labels in the same cluster group, and finally the best position of the label is determined in combination with the grid bitmap and the grid bitmap is updated. Through the marking function and priority mechanism of the grid bitmap, the best position is allocated for the label in a local range, the overlapping phenomenon of labels or labels is effectively avoided, and the visualization display effect and user experience of the map are improved.
[0085] Optionally, for how to generate the grid bitmap and the cluster group, a possible implementation manner is provided as follows. Figure 1The sub-step of step S10 can include:
[0086] According to the size of the current view window map and the preset grid size, an initial grid bitmap corresponding to the current view window map is generated; each grid in the initial grid bitmap is not occupied; the occupation state of the grid where each label is located in the initial grid bitmap is set as occupied, to obtain a grid bitmap; according to the spatial distribution of the labels and a preset clustering threshold, the labels and the labels in the current view window map are clustered, to obtain a plurality of clustering groups.
[0087] In the embodiment of the application, the current view window map is uniformly divided according to the preset grid size, the current view window map is divided into a plurality of grids, and a grid map corresponding to the current view window map is obtained. The preset grid size can be set according to the zooming of the actual map. Assuming that the current view window map is 640*320 pixels, the preset grid size is set to 64*32 pixels, and the grid map corresponding to the current view window map contains 100 grids.
[0088] Based on the grid map corresponding to the current view window map, an initial grid bitmap corresponding thereto is generated, and the bits corresponding to each grid in the initial grid bitmap are set as unoccupied, that is, all grids are not occupied in the initial state. It can be understood that, taking 100 grids as an example, the initial grid bitmap can be a binary two-dimensional array structure of 10 rows and 10 columns, and each element in the array can be set to 0 (representing unoccupied).
[0089] Further, the actual distribution of the labels in the current view window map is reflected, the map coordinates corresponding to each label are determined by traversing all the labels in the current view window map, and the map coordinates are converted into pixel positions in the grid map. Subsequently, the labels in the line-of-sight range are sorted in ascending order according to the drawing event, and the occupation states of the grids where the labels are located are marked as occupied in the ascending order, to ensure that the subsequent label position allocation can avoid the occupied areas.
[0090] By analyzing the spatial distance relationship between the labels and combining the preset clustering threshold, the labels can be divided into a plurality of independent clustering groups. The setting of the clustering threshold ensures the local independence of the labels and the labels in each clustering group, thereby reducing the possibility of multiple labels overlapping in the same area.
[0091] It can be understood that the clustering group refers to a set of mutually non-overlapping labels and their corresponding label sets. This clustering processing is based on the spatial distribution characteristics of the labels, aims to reduce the potential conflicts between the labels, and at the same time ensures that the labels and the labels in each clustering group have a certain local proximity.
[0092] It can be seen that the embodiment of the present application avoids the overlapping of labels in the interface of the current window map by scientific space division and grouping strategy. It can be understood that the grid processing provides a clear reference framework for label position allocation, ensuring that the position allocation of each label can be accurately managed in units of grids. Then, the grid bitmap effectively marks the space occupied by the label in the current window map, providing a clear restriction condition for subsequent label position allocation. Any candidate position of the label must avoid the occupied grid, thereby fundamentally avoiding the overlapping between the label and the label. Reasonable grouping is performed according to the spatial proximity of the label, and the potential conflict between different labels is reduced.
[0093] Optionally, for how to screen a label (i.e., a to-be-processed label) to be allocated a position from a pile of labels by using the priority of the cluster group and the priority of the label, the following provides a possible implementation manner. Figure 1 The sub-step of step S40 can include:
[0094] In order of high and low priority of the cluster group, each cluster group is determined as a to-be-processed cluster group in turn; in order of high and low priority of each label in the to-be-processed cluster group, each label in the to-be-processed cluster group is determined as a to-be-processed label in turn; the priority of the label is determined according to the distance between the cluster center of the cluster group where the label is located and the position of the label corresponding to the label.
[0095] In the embodiment of the present application, the distance between the cluster center of the cluster group and the center of the current window map is determined as the first distance, and the priority of the cluster group is inversely proportional to the first distance, that is, the cluster group closer to the current window map has a higher priority, thereby ensuring that the labels in the cluster group close to the central region of the current window map can be preferentially allocated a reasonable position.
[0096] That is, assuming that the cluster densities of the cluster groups are all the same, first, the cluster group closest to the center of the current window map is taken as a to-be-processed cluster group, and each label in the to-be-processed cluster group is allocated a position, until all the labels in the to-be-processed cluster group have been allocated a position, then the cluster group next closest to the center of the current window map is taken as a to-be-processed cluster group, and the expansion is performed from the center to the periphery of the current window map, until all the cluster groups are processed.
[0097] For each to-be-processed cluster group, the distance between the cluster center of the cluster group where the label is located and the position of the label corresponding to the label is determined as the second distance, and the priority of the label is inversely proportional to the second distance, that is, the label closer to the cluster center has a higher priority, thereby ensuring that the label position allocation can preferentially consider the label close to the cluster center, thereby realizing the optimal solution in a local range.
[0098] That is, first, the label closest to the cluster center is taken as a to-be-processed label, a position is assigned to the to-be-processed label, then the label next closest to the cluster center is determined as a to-be-processed label, and the cluster center is expanded to the four directions until all labels in the cluster group are processed, and then the next cluster group is processed.
[0099] It can be seen that, by means of the double ordering mechanism of the cluster group priority and the label priority, the embodiment of the application realizes the ordered processing logic from the global to the local, and completes the scientific management of the label position assignment sequence. Not only can the cluster group close to the center of the current view window map be preferentially processed in the global range, but also the label close to the cluster center can be preferentially processed in the local range, so that the label position assignment can be gradually promoted in a reasonable order, the calculation complexity can be effectively reduced, and the efficiency and accuracy of the label position assignment are improved.
[0100] Optionally, the following possible implementation is provided for how to assign a best position to the to-be-processed label. Figure 1 The sub-step of step S70 can include:
[0101] The position of the to-be-processed label is obtained by solving the greedy target function according to the candidate position of the to-be-processed label, the priority coefficient of the candidate position and the grid bitmap, and the occupation state of the grid where the to-be-processed label is located in the grid bitmap is set to occupied.
[0102] In the embodiment of the application, the core idea of the label position assignment is to construct a regional block logic based on the greedy algorithm, and to calculate the label position in combination with a cost calculation algorithm. The candidate position of the to-be-processed label, the priority coefficient of the candidate position and the grid bitmap are taken as input data for the greedy target function solving process. The solving process of the greedy target function not only considers the priority of the candidate position itself, but also fully combines the occupation state information provided by the grid bitmap, so as to ensure that the label position assignment can realize a local optimal solution under the premise of avoiding overlapping, effectively reduce the potential conflict between labels, and improve the calculation efficiency of the algorithm.
[0103] Once the position of the to-be-processed label is determined, the occupation state of the grid where the label is located in the grid bitmap needs to be immediately updated to occupied, so as to provide accurate reference information for subsequent position assignment of the to-be-processed label, so as to ensure the coherence and consistency of the overall label position assignment.
[0104] It can be understood that, by means of the greedy algorithm, the embodiment of the application analyzes the labels based on the number of labels displayed on the two-dimensional map, so as to realize the function of label avoidance display. Specifically, the decision variable is the position of all labels, the target function is that the distances of all labels are as small as possible and balanced (i.e. the maximum distance is as small as possible), and the constraint condition is that different labels cannot overlap, and the label number and the label cannot overlap.
[0105] As can be seen, this embodiment of the invention only needs to consider unoccupied candidate positions and their priority coefficients within a local area when solving the greedy objective function, without needing to comprehensively evaluate all possible positions across the entire map interface. This local optimization strategy allows the algorithm to significantly reduce computational load while ensuring result quality. In other words, by limiting the range of candidate positions and using a greedy objective function to solve for locally optimal positions, the goal of reducing computational complexity while ensuring the quality of signage allocation is achieved.
[0106] Optionally, regarding how to calculate the priority coefficient of candidate positions, the following is a possible implementation method. The formula for calculating the priority coefficient is:
[0107]
[0108] Among them, P i Let be the priority coefficient of sign i at candidate position p; Importance i α is the importance coefficient of the label corresponding to label i; β is the repulsive force weight; β is the attractive force weight, which is positively correlated with the label importance coefficient; γ is the clustering priority weight. Let p be the distance between the candidate position p corresponding to sign i and the label number corresponding to sign i. C represents the distance between candidate position p corresponding to sign i and other signs j; k The cluster group to which sign i belongs; ClusterPriority(C k ) is the cluster group C k Priority.
[0109] In this embodiment of the invention, the attraction weight is positively correlated with the label importance coefficient β = 1 + 0.5 × Importance i The Analytic Hierarchy Process (AHP) introduces a label importance coefficient. The repulsion weight is adaptively adjusted based on the crowding level of the current viewport map, and is linearly related to the screen crowding level (Crowdedness). The theoretical basis is a particle system collision model. For example, if the repulsion weight is set to α = 1.2 + 0.3 × Crowdedness, the formula for calculating screen crowding level (Crowdedness) is:
[0110]
[0111] Where, N b N represents the number of signs in the current window. p The number of grid cells in the current viewport.
[0112] It should be understood that the calculation of the priority coefficient combines multiple factors such as the repulsion weight, the attraction weight, and the cluster priority weight. Among them, the attraction weight is positively correlated with the label importance coefficient corresponding to the label. The higher the label importance coefficient, the greater the attraction weight. The repulsion weight is adjusted according to the screen congestion degree to avoid mutual interference between labels. In addition, the distance between the candidate position and the label corresponding to the label needs to be considered. The closer the distance, the greater the influence of the attraction. At the same time, the distance between the candidate position and other labels also needs to be considered. The closer the distance, the greater the influence of the repulsion.
[0113] Further, the cluster priority weight also affects the priority coefficient. The cluster priority weight is set according to experimental experience data, for example, set to 0.06. According to the attraction and repulsion theory, the priority coefficient of each candidate position is calculated.
[0114] Optionally, for how to define the greedy target function, a possible implementation is provided as follows. The greedy target function is:
[0115]
[0116] wherein, is the position of the label i; Candidates i is the candidate position of the label i; P i (p) is the priority coefficient of the label i at the candidate position p; G is the grid bitmap; Π(·) is the continuous multiplication function; Area(p) is the grid corresponding to the candidate position p occupied by the label i.
[0117] In the embodiment of the application, the process of determining the label position can be realized by an optimization method based on the greedy target function. The core idea of the greedy target function is to combine the priority coefficient of the label i at the candidate position with the occupation state of the corresponding candidate position in the grid bitmap, so as to ensure that the selected position not only meets the priority requirement, but also does not conflict with other occupied grids.
[0118] The finally selected position of the label i is determined by maximizing a comprehensive evaluation value. This evaluation value is composed of two parts. The first part is the priority coefficient of the label i at the candidate position p, and the second part is the result obtained by continuously multiplying the state values of all grids occupied by the candidate position p. In this way, both the advantages and disadvantages of the candidate position itself are considered, and the availability of the selected position in the grid bitmap is ensured.
[0119] It's worth noting that to determine the optimal location for the sign, the position that maximizes the overall value needs to be selected from all candidate positions. This overall value depends not only on the priority coefficient but also on whether the grid containing the candidate position is already occupied. If the grid containing the candidate position is already occupied, the overall value for that position will be zero, thus eliminating it from the selection process. Ultimately, the candidate position selected in this way is the optimal location for the sign, taking into account both the merits of the candidate positions themselves and ensuring the availability of the selected position within the grid bitmap, effectively avoiding labels and signs whose positions have already been determined.
[0120] It should be noted that, in order to conform to the user's visual focus movement pattern, a direction priority can be set. This ensures that, during the greedy objective function solution process, while satisfying the priority coefficients of candidate positions and the constraints of the grid bitmap, the direction priority constraint must also be followed. For example, the direction priority can be set to right > down > left > up, but this invention does not limit this.
[0121] Optionally, in practical applications, it is necessary to draw the labels and signs onto the current viewport map interface for user viewing. Below is one possible implementation method for drawing labels and signs. Please refer to... Figure 2 ,exist Figure 1 Following step S70, the method further includes the following steps:
[0122] Step S80: Draw sign icons on the current window map interface according to the location of each sign to be processed, and input the display information of the signs to be processed into the corresponding sign icons.
[0123] In this embodiment of the invention, the sign icon is a visual element used to display the geographic feature information corresponding to the label, and its position is determined by the position of the sign to be processed by a greedy algorithm. The corresponding sign icon is drawn on the current window map interface according to the specific position of the sign to be processed.
[0124] To provide richer information display, the display information of the signs to be processed needs to be entered into the corresponding sign icons. This information introduces the sign's corresponding number, including the place name and geographical location. This allows users to directly access detailed information related to the sign number through the sign icon, thereby enhancing the information delivery capability of the map interface.
[0125] Step S90: Draw lines connecting the sign icons and corresponding number icons of each sign to be processed on the current window map interface; the number icons correspond one-to-one with the numbers.
[0126] In the embodiment of the present application, the label icon is used to identify the graphic symbol of a specific geographic feature (i.e. label, such as place name, building, etc.) on the map, and each label corresponds to a label icon. The connection between the label icon of each label to be processed and the corresponding label icon is drawn on the interface of the current view window map, and the connection can intuitively represent the association between the label icon and the corresponding label icon, which can help the user quickly identify the corresponding label of each label, and also avoid information confusion in the complex map interface.
[0127] It should be noted that when the map is zoomed in, the position of the label can be recalculated according to the change of the center point of the map, and the display is updated according to the recalculated position.
[0128] It can be seen that the embodiment of the present application realizes clear and visual display of the map interface through accurate drawing of the label icon, the label icon and the connection therebetween. Not only can the label overlapping phenomenon be effectively avoided, but also the accurate transmission and intuitive presentation of geographic information can be ensured, such as shown in Figure 3 .
[0129] Based on the same inventive concept, the basic principle and the technical effects of the map label avoidance device provided by the embodiment of the present application are the same as those of the above-mentioned embodiment. For brevity of description, the part not mentioned in the present embodiment can refer to the corresponding content in the above-mentioned embodiment.
[0130] Please refer to Figure 4 , Figure 4 for a block schematic diagram of the map label avoidance device 200 provided by the embodiment of the present application. The map label avoidance device 200 includes a division module 201, a determination module 202 and a processing module 203.
[0131] The division module 201 is used to generate a grid bitmap and a plurality of clustering groups according to the current view window map; the grid bitmap is used to mark the situation that the grid map corresponding to the current view window map is occupied by the label and the label in the current view window map; the clustering groups each contain labels and labels that do not overlap with each other; the labels and the labels correspond to each other in one-to-one manner;
[0132] The determining module 202 is configured to determine the priority of each cluster group according to the distance between the cluster center of each cluster group and the center of the current view window map and the cluster density of the cluster group, and determine the priority of the label in each cluster group according to the position of the label in each cluster group; the priority of each label is determined in sequence as a label to be processed according to the priority of the cluster group and the priority of the label in the cluster group; the candidate position of the label to be processed is determined according to the position of the mark point corresponding to the label to be processed; the candidate position is a grid in a preset range of the grid map corresponding to the current view window map and centered on the mark point corresponding to the label to be processed; and the priority coefficient of each candidate position is determined according to the priority of the cluster group where the label to be processed is located, the candidate position where the label to be processed is located, the position of the label corresponding to the label to be processed, and the position of the other labels in the cluster group where the label to be processed is located.
[0133] The processing module 203 is configured to determine the position of the label to be processed according to the candidate position of the label to be processed, the priority coefficient of the candidate position and the grid bitmap, and update the grid bitmap according to the position of the label to be processed.
[0134] In summary, the map label avoidance device provided by the embodiment of the application can determine the occupation state and spatial distribution relationship of the label and the label by generating a grid bitmap and a plurality of cluster groups according to a current view window map, wherein the grid bitmap is used to mark the occupation state of the grid map, and each cluster group contains labels and labels that do not overlap with each other. Based on this, the priority of the cluster group is determined based on the distance between the cluster center and the center of the view window map and the cluster density, and the priority of the label is determined according to the position of the label, so that the label to be processed is selected in sequence according to the priority order. The candidate position is determined in the grid within a preset range and centered on the mark point corresponding to the label to be processed, and the priority coefficient is calculated by comprehensively considering the priority of the cluster group, the candidate position, the position of the label and the position of the other labels in the same cluster group. Finally, the best position of the label is determined in combination with the grid bitmap, and the grid bitmap is updated. Through the marking function and the priority mechanism of the grid bitmap, the best position of the label is allocated in a local range, and the overlapping phenomenon between the label and the label and between the label and the label is effectively avoided.
[0135] Optionally, the dividing module 201 is specifically configured to generate an initial grid bitmap corresponding to the current view window map according to the size of the current view window map and a preset grid size; each grid in the initial grid bitmap is not occupied; set the occupation state of the grid where each label is located in the initial grid bitmap as occupied to obtain the grid bitmap; and cluster the labels and the labels in the current view window map according to the spatial distribution of the labels and a preset clustering threshold to obtain a plurality of cluster groups.
[0136] Optionally, the determining module 202 is specifically configured to determine each cluster group as a to-be-processed cluster group in turn according to the high-low order of the priority of the cluster groups; and determine each label in the to-be-processed cluster group as a to-be-processed label in turn according to the high-low order of the priority of each label in the to-be-processed cluster group; the priority of the label is determined according to the distance between the cluster center of the cluster group where the label is located and the position of the label corresponding to the label.
[0137] Optionally, the processing module 203 is specifically configured to solve the greedy target function according to the candidate position of the to-be-processed label, the priority coefficient of the candidate position and the grid bitmap, to obtain the position of the to-be-processed label; and set the occupation state of the grid where the to-be-processed label is located in the grid bitmap as occupied.
[0138] Optionally, the processing module is further configured to draw a label icon on the interface of the current window map according to the position of the label corresponding to each to-be-processed label; draw a label icon on the interface of the current window map according to the position of each to-be-processed label, and input the display information of the to-be-processed label into the corresponding label icon; and draw a connection line between the label icon of each to-be-processed label and the corresponding label icon on the interface of the current window map.
[0139] Please refer to Figure 5 A block schematic diagram of an electronic device 300 is provided for the embodiments of the present application. The electronic device 300 includes, but is not limited to, a personal computer (PC), a Personal Digital Assistant (PDA), a notebook computer, a tablet computer, a server, and the like. The electronic device 300 includes a memory 310, a processor 320, and a communication module 330. The memory 310, the processor 320, and the communication module 330 are directly or indirectly electrically connected to each other to realize the transmission or interaction of data. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines.
[0140] The memory 310 is configured to store programs or data. The memory 310 can be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electric Erasable Programmable Read-Only Memory (EEPROM), and the like.
[0141] The processor 320 is configured to read / write data or programs stored in the memory 310, and perform corresponding functions. For example, when a computer program stored in the memory 310 is executed by the processor 320, the map sign avoidance method disclosed in the above embodiments can be implemented.
[0142] The communication module 330 is configured to establish a communication connection between the electronic device 300 and other communication terminals through a network, and configured to receive / transmit data through the network.
[0143] It should be understood that, Figure 5 The structure shown is only a structural schematic diagram of the electronic device 300, and the electronic device 300 can further include more or less components than those shown in the figures, or have a different configuration from that shown in the figures. Figure 5 The components shown in the figures can be implemented in hardware, software or a combination thereof. Figure 5 The components shown in the figures can be implemented in hardware, software or a combination thereof. Figure 5 The components shown in the figures can be implemented in hardware, software or a combination thereof.
[0144] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by the processor 320 to implement the map sign avoidance method disclosed in the above embodiments.
[0145] The embodiments of the present application further provide a program product, and the program product is executed by the processor 320 to implement the map sign avoidance method disclosed in the above embodiments.
[0146] In several embodiments provided by the present application, it should be understood that the disclosed device and method can also be implemented by other manners. The device embodiments described above are only schematic, and the flowcharts and block diagrams in the drawings show the possible implementation architectures, functions and operation of the device, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders from those noted in the drawings. For example, two consecutive blocks can actually be executed in a substantially parallel manner, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system for executing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0147] In addition, each functional module in various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0148] If the functions are realized in the form of software functional modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0149] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for avoiding map signs, characterized in that, The method includes: A grid bitmap and multiple cluster groups are generated based on the current viewport map; the grid bitmap is used to mark the situation where the grid map corresponding to the current viewport map is occupied by the labels and signs in the current viewport map; each cluster group contains non-overlapping labels and signs; the labels and signs correspond one-to-one; The priority of each cluster group is determined based on the distance between the cluster center of each cluster group and the center of the current viewport map, as well as the cluster density of the cluster group; the cluster density is determined based on the number of labels within the cluster group. The priority of the sign in each cluster group is determined according to the position of the label in each cluster group; According to the priority of the cluster group and the priority of the sign in the cluster group, each sign is determined as a sign to be processed in sequence; The candidate position of the sign to be processed is determined based on the position of the punctuation corresponding to the sign to be processed; the candidate position is a grid within a preset range centered on the punctuation corresponding to the sign to be processed in the grid map corresponding to the current window map; The priority coefficient of each candidate position is determined based on the priority of the cluster group to which the sign to be processed belongs, the candidate position of the sign to be processed, the position of the label corresponding to the sign to be processed, and the positions of other signs in the cluster group to which the sign to be processed belongs. The position of the sign to be processed is determined based on the candidate position of the sign to be processed, the priority coefficient of the candidate position, and the grid bitmap, and the grid bitmap is updated based on the position of the sign to be processed.
2. The map sign avoidance method according to claim 1, characterized in that, The process of generating a grid bitmap and multiple cluster groups based on the current viewport map includes: An initial grid bitmap corresponding to the current viewport map is generated based on the current viewport map size and a preset grid size; none of the grids in the initial grid bitmap are occupied; The grid is obtained by setting the occupancy status of each grid number in the initial grid bitmap to occupied. Based on the spatial distribution of the labels and the preset clustering threshold, the labels and signs in the current view map are clustered to obtain multiple cluster groups.
3. The map sign avoidance method according to claim 1, characterized in that, The step of determining each sign as a sign to be processed in sequence according to the priority of the cluster group and the priority of the sign in the cluster group includes: According to the priority order of the cluster groups, each cluster group is determined as a cluster group to be processed in turn; According to the priority order of each label in the cluster to be processed, each label in the cluster to be processed is determined as a label to be processed in turn; the priority of the label is determined according to the distance between the cluster center of the cluster to which the label belongs and the position of the label number corresponding to the label.
4. The map sign avoidance method according to claim 1, characterized in that, The step of determining the position of the sign to be processed based on the candidate positions of the sign to be processed, the priority coefficient of the candidate positions, and the grid bitmap, and updating the grid bitmap based on the position of the sign to be processed, includes: The greedy objective function is solved based on the candidate positions of the sign to be processed, the priority coefficients of the candidate positions, and the grid bitmap to obtain the position of the sign to be processed; Set the occupancy status of the grid containing the sign to be processed in the grid bitmap to occupied.
5. The map sign avoidance method according to claim 1, characterized in that, The formula for calculating the priority coefficient is: Among them, P i Let be the priority coefficient of sign i at candidate position p; Importance i α is the importance coefficient of the label corresponding to label i; β is the repulsive force weight; β is the attractive force weight, which is positively correlated with the label importance coefficient; γ is the clustering priority weight. Let p be the distance between the candidate position p corresponding to sign i and the label number corresponding to sign i. C represents the distance between candidate position p corresponding to sign i and other signs j; k The cluster group to which sign i belongs; ClusterPriority(C k ) is the cluster group C k Priority.
6. The map sign avoidance method according to claim 4, characterized in that, The greedy objective function is: in, The location of sign i; Candidates i P is the candidate position for sign i; i (p) is the priority coefficient of sign i at candidate position p; G is the grid bitmap; ∏(·) is the product function; Area(p) is the grid corresponding to the candidate position p occupied by sign i.
7. The map sign avoidance method according to claim 1, characterized in that, After determining the position of the sign to be processed based on the candidate positions of the sign to be processed, the priority coefficient of the candidate positions, and the grid bitmap, and updating the grid bitmap based on the position of the sign to be processed, the method further includes: According to the location of each sign to be processed, draw sign icons on the interface of the current window map, and input the display information of the sign to be processed into the corresponding sign icon; Draw lines connecting the sign icons and corresponding number icons of each sign to be processed on the interface of the current window map; the number icons correspond one-to-one with the numbers.
8. A map sign avoidance device, characterized in that, The device includes: The partitioning module is used to generate a grid bitmap and multiple cluster groups based on the current window map; the grid bitmap is used to mark the situation where the grid corresponding to the current window map is occupied by the labels and signs in the current window map; each cluster group contains non-overlapping labels and signs; the labels and signs correspond one-to-one; A determining module is used to determine the priority of each cluster group based on the distance between the cluster center of each cluster group and the center of the current viewport map, and the cluster density of the cluster group; the cluster density is determined based on the number of labels within the cluster group; the priority of the labels in each cluster group is determined based on the position of the labels in each cluster group; each label is sequentially determined as a label to be processed according to the priority of the cluster group and the priority of the labels in the cluster group; a candidate position for the label to be processed is determined based on the position of the marker corresponding to the label to be processed; the candidate position is a grid within a preset range centered on the marker corresponding to the label to be processed in the grid map corresponding to the current viewport map; and a priority coefficient for each candidate position is determined based on the priority of the cluster group to which the label to be processed belongs, the candidate position of the label to be processed, the position of the marker corresponding to the label to be processed, and the positions of other labels in the cluster group to which the label to be processed belongs. The processing module is used to determine the position of the sign to be processed based on the candidate position of the sign to be processed, the priority coefficient of the candidate position and the grid bitmap, and update the grid bitmap based on the position of the sign to be processed.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program that can be executed by the processor to implement the map sign avoidance method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the map sign avoidance method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method and system for avoiding mark conflicts for electronic map
CN102024376A
Traffic sign generation method and device, equipment and storage medium
CN117689832A