Interest point bounding box obtaining method, map rendering method, device and program product
In the bounding box generation method of the point of interest, the bounding box overlap area is removed based on the style layout and subordinate relationship of the point of interest, and the problem of inaccuracy of bounding box in the prior art is solved, and the accuracy of collision detection and user experience are improved.
Patent Information
- Application Number
- CN202311766803.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-06-20
AI Technical Summary
When generating a bounding box with points of interest, the prior art ignores the display area gaps of different display information, resulting in a large number of blank areas in the bounding box, affecting the accuracy of collision detection.
By obtaining the style layout of the points of interest, the bounding box of the elements to be displayed associated with the node is determined, and the overlapping areas between the bounding boxes are removed based on the node's affiliation, and a bounding box reflecting the actual appearance of the points of interest is generated.
The accuracy of the point of interest enclosure box is improved, the blank area in the enclosure box is reduced, and the enclosure box is more in line with the actual appearance of the POI, thereby improving the accuracy of collision detection, increasing the number of POIs that can be displayed on the electronic map, and improving the user experience.
Smart Images

Figure CN120179923A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of map rendering, and particularly to a method for obtaining a bounding box of a point of interest, a map rendering method, an apparatus, and a program product. Background Art
[0002] Map data is the expression of geographical entities in the real world in the digital world. Map data usually includes: roads, points of interest (POIs), etc. Among them, a POI can represent a building, a store, a scenic spot, etc. in the real world.
[0003] In order to enable users to intuitively see the real world in the digital world, the prior art usually uses a rendering engine to render roads, POIs, etc. in the map data into a visual electronic map displayed on a device screen for users to view. Since the number of POIs is huge, in order to ensure that the elements of the POIs displayed in the visual electronic map do not overlap as much as possible, the prior art usually needs to perform occlusion detection on the POIs to be displayed, which can also be called collision detection. Common collision detection technologies determine whether the elements to be displayed of two POIs overlap by detecting whether the bounding boxes of the two points of interest overlap. The inventors of the present application found that since the result of the collision detection directly affects whether a POI can be displayed in the visual electronic map, and the accuracy of the bounding box of the point of interest has a great impact on the result of the POI collision detection. Therefore, how to generate a bounding box that can reflect the actual shape of the POI is a problem that those skilled in the art need to solve. Summary of the Invention
[0004] The present application provides a method for obtaining a bounding box of a point of interest, a map rendering method, an apparatus, and a program product, which can generate a bounding box that reflects the actual shape of the point of interest and improve the accuracy of the bounding box of the point of interest.
[0005] In a first aspect, the present application provides a method for obtaining a bounding box of a point of interest, the method comprising:
[0006] Obtaining the style layout of the point of interest;
[0007] Obtaining the bounding box of the element to be displayed associated with the node according to the element to be displayed of the point of interest associated with the node in the style layout;
[0008] Removing the overlapping regions between the bounding boxes according to the subordinate relationship of the nodes in the style layout to obtain the bounding box of the point of interest.
[0009] Optionally, if the subordinate relationship is a parent-child relationship, then the removing the overlapping regions between the bounding boxes according to the subordinate relationship of the nodes in the style layout to obtain the bounding box of the point of interest includes:
[0010] Generate a style layout tree according to the elements to be displayed of the points of interest associated with the nodes in the said style layout. The style layout tree stores the parent-child relationships between the said nodes;
[0011] For two nodes with the said parent-child relationship, if it is determined based on the style layout that the elements to be displayed associated with the child node need to be displayed within the elements to be displayed associated with the parent node, then remove the bounding box of the elements to be displayed associated with the child node;
[0012] For the bounding boxes of the remaining elements to be displayed, in the set coordinate system of the points of interest, determine and remove the overlapping regions of the bounding boxes of the remaining elements to be displayed to obtain the bounding box of the points of interest.
[0013] Optionally, the bounding box of the element to be displayed is a rectangular bounding box, and the rectangular bounding box includes a length and a width. The step of determining and removing the overlapping regions of the bounding boxes of the remaining elements to be displayed in the set coordinate system of the points of interest to obtain the bounding box of the points of interest includes:
[0014] Based on the set coordinate system of the points of interest and the length and width of the rectangular bounding boxes of the remaining elements to be displayed, obtain the position regions covered by the rectangular bounding boxes of the remaining elements to be displayed in the set coordinate system of the points of interest;
[0015] According to the position regions covered by the rectangular bounding boxes of the remaining elements to be displayed in the set coordinate system of the points of interest, determine and remove the overlapping regions between the rectangular bounding boxes of the remaining elements to be displayed to obtain the bounding box of the points of interest.
[0016] Optionally, the position region is represented by the position coordinates of the two diagonal vertices of the rectangular bounding box in the coordinate system of the points of interest. The horizontal axis and the vertical axis of the coordinate system of the points of interest are respectively parallel to the two mutually perpendicular sides of the rectangular bounding box, and the origin of the coordinate system of the points of interest coincides with one of the vertices of the rectangular bounding boxes of the remaining elements to be displayed.
[0017] Optionally, the step of determining and removing the overlapping regions between the rectangular bounding boxes of the remaining elements to be displayed according to the position regions covered by the rectangular bounding boxes of the remaining elements to be displayed in the set coordinate system of the points of interest to obtain the bounding box of the points of interest includes:
[0018] Determine the overlapping regions between the rectangular bounding boxes according to the position regions covered by the rectangular bounding boxes of the elements to be displayed in the coordinate system of the points of interest;
[0019] Delete the position coordinates of the diagonal vertices that form the overlapping area in the rectangular bounding box, and determine the bounding box of the point of interest through the position coordinates of the remaining diagonal vertices of the rectangular bounding box.
[0020] Optionally, the obtaining the bounding box of the to-be-displayed element associated with the point of interest according to the to-be-displayed element associated with the point of interest in the style layout includes:
[0021] Generate the bounding box of the to-be-displayed element associated with the node according to the to-be-displayed element associated with the point of interest in the style layout.
[0022] In a second aspect, the present application provides a map rendering method, and the method includes:
[0023] Obtain map rendering data, where the rendering data includes the style layout of the points of interest to be displayed and map data;
[0024] Based on the method described in any one of the first aspect, obtain the bounding box of the to-be-displayed point of interest;
[0025] Perform collision detection according to the bounding box of the to-be-displayed point of interest to determine whether the point of interest is displayed in the collision detection result of the electronic map;
[0026] Render the electronic map according to the collision detection result of the point of interest, the map data, and the map rendering parameters.
[0027] In a third aspect, the present application provides a device for obtaining a bounding box of a point of interest, and the device includes:
[0028] An obtaining module, configured to obtain the style layout of the point of interest;
[0029] A processing module, configured to obtain the bounding box of the to-be-displayed element associated with the node according to the to-be-displayed element associated with the point of interest in the style layout; and remove the overlapping area between the bounding boxes according to the subordinate relationship of the nodes in the style layout to obtain the bounding box of the point of interest.
[0030] In a fourth aspect, the present application provides a map rendering device, and the device includes:
[0031] A first obtaining module, configured to obtain map rendering data; wherein, the rendering data includes the style layout of the points of interest to be displayed and map data;
[0032] A second obtaining module, configured to obtain the bounding box of the to-be-displayed point of interest based on the method described in any one of the first aspect;
[0033] A processing module, configured to perform collision detection based on the bounding box of the point of interest to be displayed, so as to determine whether the point of interest is displayed in the electronic map as a collision detection result;
[0034] A rendering module, configured to render an electronic map according to the collision detection result of the point of interest, the map data, and map rendering parameters.
[0035] In a fifth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in any one of the first aspect or the second aspect.
[0036] In a sixth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method described in any one of the first aspect or the second aspect.
[0037] In a seventh aspect, the present application provides an electronic device, including: a processor and a memory; the processor is communicatively connected to the memory;
[0038] The memory stores computer instructions;
[0039] The processor executes the computer instructions stored in the memory to implement the method described in any one of the first aspect or the second aspect.
[0040] The method for obtaining the bounding box of a point of interest provided by the present application determines the bounding box of the elements to be displayed of the point of interest through the elements to be displayed of the point of interest associated with the nodes in the style layout of the POI. Based on the subordinate relationship of the nodes in the style layout, the overlapping areas between the bounding boxes of the elements to be displayed are removed to obtain the bounding box of the POI. The above method determines the bounding box of the elements to be displayed of the point of interest, and then generates the bounding box of the point of interest based on the bounding box of the elements to be displayed of the point of interest, which makes the finally generated bounding box of the POI not include the elements to be displayed of other POIs. Moreover, the subordinate relationship of the nodes in the style layout represents the subordinate relationship (which can also be understood as an inclusion relationship) of the elements to be displayed associated with the nodes. Therefore, by using the subordinate relationship of the nodes in the style layout to remove duplicates from the bounding boxes of the elements to be displayed, the generated bounding box can reflect the actual shape of the POI, improving the accuracy of the generated bounding box of the POI compared with the existing method of representing the contour of the POI by a rectangular bounding box.
[0041] After determining the bounding box of the POI to be displayed through the above POI bounding box acquisition method, the map rendering method provided in this application can perform collision detection based on the bounding box of the POI to be displayed, and obtain the collision detection result of whether the POI is displayed on the electronic map. Since the bounding box reflecting the actual shape of the POI can be obtained through the aforementioned POI bounding box acquisition method, the accuracy of the bounding box of the POI to be displayed is improved. Therefore, the accuracy of performing collision detection based on the bounding box of the POI to be displayed to determine which POIs can be displayed on the electronic map is also improved. Furthermore, the possibility that the POI cannot be displayed due to the inaccurate bounding box of the POI is reduced, the number of POIs that can be displayed on the electronic map is increased, the information loss is reduced, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0043] Figure 1 It is a schematic diagram of a map interface display;
[0044] Figure 2 It is a schematic flowchart of a method for obtaining a POI bounding box provided in this application;
[0045] Figure 3 It is a schematic diagram of a map interface display provided in this application;
[0046] Figure 4a It is a schematic flowchart of a method for obtaining the bounding box of a point of interest according to the subordinate relationship of nodes provided in this application;
[0047] Figure 4b It is a schematic diagram of the bounding box of the display elements associated with the nodes of a POI provided in this application;
[0048] Figure 5 It is a schematic diagram of the rectangular bounding box of the display elements in the point of interest coordinate system provided in this application;
[0049] Figure 6 It is a schematic flowchart of a method for map rendering provided in this application;
[0050] Figure 7 It is a schematic flowchart of another method for map rendering provided in this application;
[0051] Figure 8Schematic flowchart of another method for obtaining a POI bounding box provided by this application;
[0052] Figure 9 Schematic structural diagram of a device for obtaining a point of interest bounding box provided by this application;
[0053] Figure 10 Schematic structural diagram of a map rendering device provided by this application;
[0054] Figure 11 Schematic hardware structure diagram of an electronic device provided by this application.
[0055] Through the above-mentioned drawings, specific embodiments of this application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. Detailed implementation manners
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the scope of protection of this application.
[0057] First, some noun concepts related to this application will be explained below:
[0058] Bounding box: In the fields of computer graphics and computational geometry, the bounding box of an object (or a combination of objects) is a closed geometric body that completely encloses the object (or the combination of objects). The geometric body is usually a regular geometric body, such as a rectangle, a circle, etc. Representing complex objects with simple bounding volumes can improve the efficiency of geometric operations.
[0059] Point of Interest (POI): It refers to a geographical entity in the real world that can be abstracted as a point of interest. Exemplarily, the geographical entity can be any geographical entity such as a store, a scenic spot, a building, a bus stop, etc.
[0060] Figure 1 Schematic diagram of an electronic map (hereinafter referred to as a map) that a user sees on the screen of a terminal device. As Figure 1As shown in the figure, the map includes roads and POIs. Among them, the POIs are specifically: xxx Apartment, Restaurant A, Hospital D, etc. The terminal device can be a mobile phone, a tablet computer, a car navigation device, etc. The map that the user sees on the screen of the terminal device can be rendered by an application software installed on the device with map rendering function. Map rendering can also be understood as "map display". When the application software renders the map, it is necessary to ensure that the elements of the POIs in the map seen by the user are not blocked.
[0061] Currently, in order to ensure that the elements to be displayed of the POIs in the map seen by the user are not blocked, when using the existing map rendering technology, collision detection technology is used to detect whether there is occlusion of the elements to be displayed of the points of interest. In order to improve the efficiency of collision detection, it is usually carried out through the outer bounding box (hereinafter referred to as the bounding box) of the POI. Taking Figure 1 the C University in the shown map as an example, the display information (also known as the display elements) of this POI includes: the name of the POI (C University), the dotted line texture (used to indicate that the geographical area within the dotted line belongs to C University), and the location icon. The bounding box a of this POI generated by the existing technology is as shown by the solid rectangle in Figure 1 . The bounding box a needs to enclose the poi name, the dotted line texture, and the location icon. During collision detection, it can be detected whether there is an overlapping area between the bounding boxes of two POIs. Since all the display information of the POI is located in the bounding box, if there is an overlapping area between the bounding boxes of two POIs, it can be considered that there will be an occlusion problem when the display information of these two POIs is displayed simultaneously on the map, affecting the user experience. Therefore, for the POIs with overlapping bounding boxes, the POIs that are not to be displayed can be determined through the display priority of the POIs, etc. The POIs that are not to be displayed are the POIs that are collided. For the collided POIs, all the display elements located within the bounding box will not be displayed.
[0062] Still taking Figure 1 as an example, assume that the POIs to be displayed on the map include: Restaurant A, xxx Apartment (the dotted line texture of which is used to indicate that the geographical area within the dotted line belongs to this xxx Apartment), C University, Hospital D, Building 3 of xxx Building, and E Life Supermarket. Among them, the bounding boxes corresponding to the POIs generated by the existing technology are as shown in Figure 1The six solid rectangular boxes in []. If through collision detection, it is determined that there is an overlapping area between the bounding box f of E Life Supermarket and the bounding box b of xxx Apartment, and if the display priority of E Life Supermarket is lower than that of xxx Apartment, then the bounding box f of xxx Apartment is collided and removed, that is, the display information located within the bounding box f of xxx Apartment will no longer be displayed. Therefore, the user can see the information of A Restaurant, xxx Apartment, C University, D Hospital, and the information of Building 3 of xxx Building in the map, but cannot see the information of E Life Supermarket.
[0063] However, the inventors of the present application found that the prior art generates a bounding box that encloses multiple display information of a POI. When the bounding box is a rectangle, the bounding box must be the maximum circumscribed rectangle that can enclose all the display information of the POI. Such a bounding box ignores the gap in the display areas required by different display information, and there are a large number of blank areas in the bounding box where there is no display information of the POI, which will obviously cause inaccurate collision detection. In addition, once the bounding box is collided and removed, multiple display information of the POI will no longer be displayed. Although the problem of possible information occlusion is solved, it also brings about a reduction in the displayed POIs, resulting in information loss.
[0064] To solve the above problems existing in the prior art, the present application proposes a method for generating a bounding box of a POI, which can generate a more accurate bounding box for the POI. The so-called more accurate means minimizing the blank areas in the bounding box as much as possible, making the area covered by the bounding box more conform to the display areas required by each display information of the POI, thereby improving the accuracy of the POI collision detection result. Since the bounding box of the POI generated by the present application will be more accurate, the contour of the bounding box may no longer be a regular rectangle, but an irregular polygon. Such a bounding box can also be called a special-shaped bounding box.
[0065] The following will separately elaborate on the technical solutions for generating the bounding box of the POI and map rendering provided by the present application in detail.
[0066] Optionally, the execution subject of the POI bounding box acquisition method can be an application software integrated with a map display function. This application software can be deployed on an electronic device, such as a mobile phone, a car navigation system, a tablet computer, etc. When this application software is deployed on a mobile phone, for example, it can be an application (APP); when deployed on a car navigation system, for example, it can be pre-installed software.
[0067] Taking the execution subject of the POI bounding box acquisition method as the above application software as an example, the technical solution of the POI bounding box acquisition of the present application will be elaborated in detail in combination with specific embodiments. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0068] Figure 2 The flowchart of a method for obtaining a POI bounding box provided for this application, and this method may include the following steps:
[0069] S101. Obtain the style layout of the POI.
[0070] Exemplarily, the style layout of the POI may include, for example: parameters for characterizing the styles of the elements to be displayed in the POI, etc. Among them, the above-mentioned elements to be displayed may include, for example: the icon of the POI, image texture (such as background image), etc. The parameters for characterizing the styles of the elements to be displayed include, for example, the size and transparency of the image, the size, font, and color of the text, and the relative position between the text and the image, etc. In some embodiments, the style layouts corresponding to the same type of POI (such as POIs of the store type) may be the same or different, and this application does not limit this.
[0071] Exemplarily, taking the elements to be displayed in the POI including 2 images as an example, the style layout of the POI may include, for example: the 2 images, the size and transparency of each image, etc.
[0072] S102. Obtain the bounding box of the elements to be displayed associated with the node according to the elements to be displayed of the point of interest associated with the node in the style layout.
[0073] Among them, a node is used to associate the style of an element to be displayed in a POI. As Figure 1 in the D Hospital, the elements to be displayed in this POI may include a location icon and the name "D Hospital". Among them, the location icon corresponds to a node, and this node will associate the style of the icon, for example, the image corresponding to the icon, the display parameters of the image (aspect ratio, whether it is highlighted, etc.). The name will correspond to a node, and this node will associate the style of the name, for example, horizontal or vertical arrangement, font, font size, font color, etc. Among them, "D Hospital" is the specific name of this hospital, and this specific name can be obtained from the map data of the POI, and this application will not elaborate further. As Figure 1 shown in the C University, the elements to be displayed in this POI may include a location icon, a dotted-line texture image, and the text "C University". Among them, the location icon corresponds to a node, the dotted-line texture image corresponds to a node, and the text "C University" corresponds to a node.
[0074] As a possible implementation, for example, an application software may generate a bounding box for the display elements associated with the point of interest (POI) in the style layout according to the display elements to be shown. Optionally, for any node, the application software is not limited in the way of generating the bounding box for the display elements associated with the node. For example, the application software may generate a bounding box for the display elements associated with the node according to the size of the display elements associated with the node. It should be understood that the application software is not limited in the shape of the bounding box for the display elements associated with any node.
[0075] As another possible implementation, taking the bounding box of the display elements and the identifier of the display elements included in the above-mentioned style layout as an example, for example, the application software may determine the bounding boxes of the respective display elements from the style layout of the POI based on the identifier of the display elements associated with the node of the POI.
[0076] S103. Remove the overlapping areas between the bounding boxes according to the subordinate relationship of the nodes in the style layout to obtain the bounding box of the point of interest.
[0077] Exemplarily, Figure 3 is a schematic diagram of a map interface display provided by the present application. As Figure 3 shown, both "xxxx Apartment" and "C University" include three display elements, namely a location icon, text, and a dotted texture (that is, both are associated with three nodes). Therefore, the bounding boxes of the POIs corresponding to "xxxx Apartment" and "C University" may each include three rectangular bounding boxes. E Life Supermarket, D Hospital, A Restaurant, and Building 3 of xxxxxx Building all include two pieces of information, namely a location icon and text (that is, both are associated with two nodes). Therefore, the bounding boxes of the POIs corresponding to E Life Supermarket, D Hospital, A Restaurant, and Building 3 of xxxxxx Building may each include two rectangular bounding boxes. As Figure 3 described, compared with the bounding box b shown in Figure 1 , the bounding box 2 can improve the accuracy of describing the overall outline of the multiple display elements of the POI, so that there is no overlapping area between the bounding box 2 and the bounding box 6 of E Life Supermarket. Furthermore, the application software can subsequently display the POI of E Life Supermarket, increasing the number of POIs that can be displayed on the page.
[0078] By removing the overlapping areas between the bounding boxes of the display elements, a bounding box that can reflect the actual shape of the POI is obtained. Taking the bounding box of the display elements as a rectangular bounding frame as an example, optionally, the POI bounding box may be composed of at least one rectangular bounding frame. That is to say, the application software can represent a bounding box of the POI through the size data and relative position data of at least one rectangular bounding frame. For example, Figure 3The bounding boxes corresponding to the xxxx apartment and C University in [location] can be composed of multiple rectangular bounding frames. The bounding boxes of E Life Supermarket, D Hospital, A Restaurant, and the xxxxxx Building can be composed of a single rectangular bounding frame respectively.
[0079] In this embodiment, the bounding box of the to-be-displayed element of the point of interest is determined by the to-be-displayed element of the point of interest associated with the node in the style layout. Based on the subordinate relationship of the nodes in the style layout, the overlapping areas between the bounding boxes of the to-be-displayed elements are removed to obtain the bounding box of the point of interest. In the above method, the bounding box of the to-be-displayed element of the point of interest is determined first, and then the bounding box of the point of interest is generated based on the bounding box of the to-be-displayed element of the point of interest. This makes the finally generated bounding box of the point of interest not include the to-be-displayed elements of other points of interest. Moreover, the subordinate relationship of the nodes in the style layout represents the subordinate relationship (which can also be understood as the inclusion relationship) of the to-be-displayed elements associated with the nodes. Therefore, by using the subordinate relationship of the nodes in the style layout to remove duplicates from the bounding boxes of the to-be-displayed elements, the generated bounding box can reflect the actual shape of the point of interest, improving the accuracy of the generated bounding box of the point of interest compared with the existing method of representing the outline of the point of interest with a single rectangular bounding box.
[0080] Taking the subordinate relationship of the nodes in the above style layout as the parent-child relationship as an example, the following will elaborate on how the application software removes the overlapping areas between the above bounding boxes according to the subordinate relationship of the nodes in the style layout to obtain the bounding box of the point of interest:
[0081] Figure 4a This is a schematic flowchart of a method for obtaining the bounding box of a point of interest according to the subordinate relationship of nodes provided by this application. As a possible implementation, the method may include the following steps:
[0082] S201. Generate a style layout tree according to the to-be-displayed element of the point of interest associated with the node in the style layout.
[0083] Among them, the style layout tree can store the parent-child relationship between the nodes in the style layout.
[0084] Optionally, an application software can, for example, obtain the sub-style layout of each node by parsing the above-mentioned style layout. Exemplarily, for any POI, the style layout of the POI can be, for example, a file including multiple node identifiers (which can also be referred to as labels), and the content corresponding to each node identifier. Among them, a node identifier can be used to represent a node, and the content corresponding to the node identifier can be used to characterize the sub-style layout of the node. In this exemplary case, the application software can parse the above-mentioned style layout by identifying the node identifiers in the style layout and obtaining the content corresponding to each node identifier, so as to obtain the sub-style layout of at least one node. Optionally, the sub-style layout of the above-mentioned element to be displayed can include data such as the shape and size of the element to be displayed. For example, the content included in the above-mentioned sample layout can be as follows:
[0085] <div style=”xxxa”>
[0086] <label style=”xxxb”>< / label>
[0087] <img style=”xxxc”>
[0088] Among them, "div", "label", and "img" can all be node identifiers, that is, used to represent nodes, and each node identifier can be associated with a display element of a POI. For example, "img" can represent a picture. "xxxa" is used to characterize the sub-style layout of the display element associated with the "div" node identifier. "xxxb" is used to characterize the sub-style layout of the display element associated with the "label" node identifier. "xxxc" is used to characterize the sub-style layout of the display element associated with the "img" node identifier.
[0089] Exemplarily, taking the style layout of the above-mentioned POI including multiple node identifiers and the content corresponding to each node identifier as an example, for any node identifier, the application software can, for example, determine that the node corresponding to the node identifier is a child node and the node corresponding to the "other node identifier" is a parent node when the node identifier and the content corresponding to the node identifier are in the "content corresponding to another node identifier", and construct a style layout tree including the parent-child relationship. It should be understood that the present application does not limit the number of child nodes corresponding to the parent node. Optionally, the application software can, for example, determine that there are no nodes with a parent-child relationship when any node identifier and its corresponding content are not in the content corresponding to other node identifiers.
[0090] S202. For two nodes with a parent-child relationship, if it is determined based on the style layout that the display element associated with the child node needs to be displayed within the display element associated with the parent node, then remove the bounding box of the display element associated with the child node.
[0091] Optionally, for two nodes with a parent-child relationship, the elements to be displayed associated with the child node can be displayed within the elements to be displayed associated with the parent node, or can be displayed outside the elements to be displayed associated with the parent node. Exemplarily, the application software can determine whether the elements to be displayed associated with the child node need to be displayed within the elements to be displayed associated with the parent node from the position layout restriction information indicating whether the elements to be displayed associated with the child node break away from the elements to be displayed associated with the parent node in the above style layout.
[0092] If the elements to be displayed associated with the child node indicated in the above style layout are displayed separately from the elements to be displayed associated with the parent node, the application software can determine that the elements to be displayed associated with the child node do not need to be displayed within the elements to be displayed associated with the parent node. If the elements to be displayed associated with the child node indicated in the above style layout are not displayed separately from the elements to be displayed associated with the parent node, the application software can determine that the elements to be displayed associated with the child node need to be displayed within the elements to be displayed associated with the parent node.
[0093] Exemplarily, Figure 4b is a schematic diagram of the bounding box of the elements to be displayed associated with a POI node provided by this application. As Figure 4b shown, assume that the element to be displayed 1 and the element to be displayed 3 can be images, and the element to be displayed 2 can be text (such as Figure 4b the xx community shown). Then, the application software can determine the bounding boxes of the respective elements to be displayed. Taking Figure 4b as an example, assume that the application software determines that the element to be displayed 2 and the element to be displayed 1 are the elements to be displayed associated with nodes having a parent-child relationship, and the node corresponding to the element to be displayed 2 is the child node of the node corresponding to the element to be displayed 1. As Figure 4b shown, if the bounding box of the element to be displayed 2 is within the bounding box of the element to be displayed 1, the application software can remove the bounding box of the element to be displayed 2 associated with the child node from the bounding box of the element to be displayed 1.
[0094] If the bounding box of the element to be displayed associated with the child node is not located within the bounding box of the element to be displayed associated with the parent node, optionally, the application software retains, for example, the bounding box of the element to be displayed associated with the parent node and the bounding box of the element to be displayed associated with the child node. Among them, the above "the bounding box of the element to be displayed associated with the child node is not located within the bounding box of the element to be displayed associated with the parent node" can include, for example, that part of the bounding box of the element to be displayed associated with the child node is within the bounding box of the element to be displayed associated with the parent node, or there is no overlap between the bounding box of the element to be displayed associated with the child node and the bounding box of the element to be displayed associated with the parent node.
[0095] If there are no nodes with a parent-child relationship between nodes, optionally, the application software can directly retain the bounding boxes of the display elements associated with each node.
[0096] Through the above method, when the bounding box of the display element associated with the child node is within the bounding box of the display element associated with the parent node, the bounding box of the display element associated with the child node is removed, which ensures the accuracy of the outline of the display element describing the POI while reducing the number of bounding boxes used to describe the overall outline of the POI, thereby improving the efficiency of determining the bounding box of the POI based on the bounding boxes of the display elements associated with each node, and further improving the efficiency of subsequent map rendering using the bounding box of the POI.
[0097] S203. For the remaining bounding boxes of the display elements, in the set POI coordinate system, determine and remove the overlapping regions of the remaining bounding boxes of the display elements to obtain the bounding box of the POI.
[0098] It should be understood that as mentioned above, the present application does not limit the shape of the bounding box of the display element. Taking the bounding box of the display element as a rectangular bounding box as an example, in some embodiments, the application software can determine the bounding box of the POI based on the position area of the bounding box of the display element in the above-mentioned set POI coordinate system.
[0099] For example, the application software can first obtain the position area covered by the rectangular bounding box of the remaining display elements in the set POI coordinate system based on the set POI coordinate system and the length and width of the rectangular bounding box of the remaining display elements.
[0100] Optionally, the above-mentioned set POI coordinate system can also be referred to as a reference coordinate system in some embodiments. Through the above-mentioned set POI coordinate system, the rectangular bounding boxes of the remaining display elements of the POI can be placed in the set POI coordinate system, and thus the relative position relationship between the rectangular bounding boxes of the remaining display elements representing the POI can be realized.
[0101] Exemplarily, the application software may first determine the set point-of-interest coordinate system based on the bounding box of the remaining elements to be displayed as described above. As a possible implementation, the application software may first obtain the rectangular bounding box of the POI based on the style layout of the POI, and then construct the set point-of-interest coordinate system according to the rectangular bounding box. Among them, the origin of the set point-of-interest coordinate system may be, for example, the vertex where the first side and the second side of the rectangular bounding box intersect. The direction of the first coordinate axis of the set point-of-interest coordinate system may be the direction extending along the first side, and the direction of the second coordinate axis of the set point-of-interest coordinate system may be the direction extending along the second side. Optionally, the application software may obtain the rectangular bounding box of the POI through existing methods for obtaining the rectangular bounding box of the POI based on the style layout of the POI, which will not be elaborated here.
[0102] Alternatively, the horizontal axis and the vertical axis of the set point-of-interest coordinate system may be respectively parallel to two mutually perpendicular sides of the rectangular bounding box of the element to be displayed as described above, and the origin of the set point-of-interest coordinate system may coincide with the vertex of one of the rectangular bounding boxes in the rectangular bounding box of the remaining elements to be displayed. Exemplarily, taking the Figure 4b POI in Figure 5 as an example, Figure 5 FIG. [FIGURE NUMBER] is a schematic diagram of the rectangular bounding box of the element to be displayed under a point-of-interest coordinate system provided by the present application. As Figure 5 shown, the origin of the set point-of-interest coordinate system may coincide with the vertex of one of the rectangular bounding boxes in the rectangular bounding box of the remaining elements to be displayed.
[0103] It should be understood that Figure 5 only an exemplary description is made with the upper left corner of the rectangular bounding box as the origin of the set point-of-interest coordinate system. In some embodiments, the origin of the set point-of-interest coordinate system may also be the lower left corner, the lower right corner, or the upper right corner, etc. of the rectangular bounding box, and the present application does not limit this. Optionally, usually the layout mode of the POI is regular, so for example, the vertex at the upper left rectangular bounding box may be selected as the origin of the set point-of-interest coordinate system. Optionally, which vertex of the rectangular bounding box the application software takes as the origin of the set point-of-interest coordinate system may be, for example, pre-determined to be the vertex with a relatively small calculation amount under the set point-of-interest coordinate system.
[0104] The origin of the set point-of-interest coordinate system can be determined by one of the vertices of the rectangular bounding box of the element to be displayed. The coordinate axes of the set point-of-interest coordinate system can be determined by two mutually perpendicular sides of the rectangular bounding box of the element to be displayed. Through the above method, the set point-of-interest coordinate system is determined based on the rectangular bounding box of the element to be displayed, reducing the calculation for determining the set point-of-interest coordinate system and reducing the data volume of the relative positions between the bounding boxes of each element to be displayed based on the set point-of-interest coordinate system. Therefore, the efficiency of determining the bounding box of the POI based on the position in the set point-of-interest coordinate system can be improved later.
[0105] The above position area can be represented by the position coordinates of the two diagonal vertices of the rectangular bounding box in the set point-of-interest coordinate system. Exemplarily, an application software can, for example, determine the length and width of the rectangular bounding box of the remaining element to be displayed based on the style layout of the POI. Taking the POI including multiple nodes as an example, the style layout of the POI can include data for characterizing "the length and width of the element to be displayed associated with each node, and the relative position relationship". The application software can, for example, convert the data to the set point-of-interest coordinate system to obtain the position area of the rectangular bounding box of the element to be displayed associated with the node in the set point-of-interest coordinate system.
[0106] Exemplarily, taking Figure 5 as an example, the position area of the bounding box of the element to be displayed associated with node 1 in the set point-of-interest coordinate system can be represented by vertices (0, 0) and (b, a) for example. Wherein, b and a represent the length and width of the element to be displayed associated with node 1. The position area of the bounding box of the element to be displayed associated with node 3 in the set point-of-interest coordinate system can be represented by vertices (d, c) and vertex (d + e, c + f) for example. Wherein, d, c, e, f can all be data included in the above style layout. d and c represent the position of the rectangular bounding box of the element to be displayed associated with node 3 relative to the rectangular bounding box of the element to be displayed associated with node 1. e and f represent the length and width of the element to be displayed associated with node 3.
[0107] In some embodiments, the origin of the set point-of-interest coordinate system can also be any point on the side of the rectangular bounding box of the element to be displayed, and the present application does not limit this.
[0108] After the application software determines the position area covered by the rectangular bounding box of the remaining element to be displayed in the set point-of-interest coordinate system, it can determine and remove the overlapping areas between the rectangular bounding boxes of the remaining element to be displayed according to the position area covered by the rectangular bounding box of the remaining element to be displayed in the set point-of-interest coordinate system to obtain the bounding box of the point of interest.
[0109] Optionally, for example, the application software may determine the overlapping area between the rectangular bounding boxes according to the position area covered by the rectangular bounding box of the element to be displayed in the point of interest coordinate system. Then, the application software may delete the position coordinates of the diagonal vertices that form the overlapping area in the rectangular bounding box, and determine the bounding box of the point of interest through the position coordinates of the remaining diagonal vertices of the rectangular bounding box.
[0110] Exemplarily, as Figure 5 shown, there is an overlapping area between the position area covered by the rectangular bounding box associated with node 1 in the point of interest coordinate system and the position area covered by the rectangular bounding box associated with node 3 in the point of interest coordinate system. Exemplarily, the position coordinates of the diagonal vertices that form the overlapping area in the rectangular bounding box are (d, c) and (d + e, a). Then, the application software may describe the bounding box of the POI based on the position coordinates of the remaining diagonal vertices (0, 0), (b, a), (d, a), (d + e, f + c).
[0111] Alternatively, for example, the application software may also determine multiple nodes with overlapping areas according to the positions of the bounding boxes of the elements to be displayed associated with the nodes in the set point of interest coordinate system. The application software may retain the rectangular bounding box of the element to be displayed associated with one of the multiple nodes, and remove the overlapping area from the rectangular bounding boxes of the elements to be displayed associated with the remaining nodes, to obtain the positions of the new rectangular bounding boxes associated with the "remaining nodes" in the set point of interest coordinate system. Then, the application software may obtain the bounding box of the POI based on the position of the rectangular bounding box of the element to be displayed associated with the retained node in the point of interest coordinate system, and the positions of the new rectangular bounding boxes associated with the "remaining nodes" in the point of interest coordinate system.
[0112] Optionally, for example, the application software may first determine which one of the multiple nodes with overlapping areas is the above-mentioned "one of the nodes". For example, for each of the nodes with overlapping areas, the application software may first remove the overlapping area in the node to obtain the shape of the node after removing the overlapping area. If the shape of the node after removing the overlapping area is not rectangular, the application software may determine that the node is the above-mentioned "one of the nodes". If the shape of the node after removing the overlapping area is still rectangular, the application software may determine that the node is the above-mentioned "remaining nodes". Then, the application software may retain the rectangular bounding box (the rectangular bounding box without removing the overlapping area) of the "one of the nodes" among the multiple nodes with overlapping areas, and remove the overlapping area from the rectangular bounding boxes of the "remaining nodes" to obtain the positions of the new rectangular bounding boxes of the "remaining nodes" in the set point of interest coordinate system.
[0113] In this implementation manner, the rectangular bounding boxes of the elements to be displayed associated with each node, and the new rectangular bounding boxes of the "other nodes" remain rectangles, such that the rectangular bounding boxes of the elements to be displayed associated with the nodes are not irregular shapes, simplifying the difficulty of expressing the rectangular bounding boxes of the elements to be displayed associated with the nodes, reducing the data volume for expressing the rectangular bounding boxes of the elements to be displayed associated with the nodes, and improving the efficiency of subsequent map rendering based on the rectangular bounding boxes of the elements to be displayed associated with the nodes.
[0114] In this implementation manner, by removing the overlapping regions from the rectangular bounding boxes of the elements to be displayed, the bounding boxes of the subsequent obtained POIs have no overlapping regions, avoiding repeated calculation of the overlapping regions when using the bounding boxes of the POIs subsequently, and thus reducing the calculation amount when determining which POIs to display on the map page based on the bounding boxes of the POIs, and improving the efficiency of map page rendering.
[0115] In this embodiment, through this point of interest coordinate system, based on this point of interest coordinate system, the position of the rectangular bounding box of the element to be displayed associated with the node in this point of interest coordinate system can be determined, and then based on this position, the overlapping regions between the rectangular bounding boxes of the elements to be displayed of the node can be removed to obtain the bounding box of this POI. Through the above method, the relative positions between the rectangular bounding boxes of the elements to be displayed of the POI are represented based on the set point of interest coordinate system, and then the overlapping regions between the rectangular bounding boxes are determined, laying a foundation for obtaining the rectangular bounding box of the POI without overlapping regions. By placing the rectangular bounding boxes of the elements to be displayed in this point of interest coordinate system, the relative positions between the elements to be displayed are described, ensuring that the rectangular bounding boxes of the elements to be displayed can form the above-mentioned bounding box of the POI according to this relative position, further improving the accuracy of the rectangular bounding box in describing the overall contour of multiple elements to be displayed of the POI, and thus the number of POIs that can be displayed on the map page can be further increased.
[0116] It should be understood that the bounding box of this POI obtained through the POI bounding box acquisition method provided by this application can be used for map rendering. Alternatively, the bounding box of this POI can also be used in other scenarios where POI bounding boxes are used, and this application does not limit this.
[0117] Taking the bounding box of this POI for determining map rendering as an example, after the application software obtains the bounding box of the POI, it can perform map rendering according to the bounding box of the POI. Figure 6 It is a schematic flowchart of a method for map rendering provided by this application. As Figure 6 shown, this method may include the following steps:
[0118] S301. Obtain map rendering data.
[0119] Among them, the rendering data may include the style layout of the POI to be displayed and map data.
[0120] Optionally, the map data may include, for example, POIs, roads, etc. The map data may also be referred to as map base data, which may be determined by the user's positioning location or the location determined when the user drags the map on the screen.
[0121] S302. Obtain the bounding box of the POI to be displayed based on the POI bounding box acquisition method.
[0122] It should be understood that the application software may obtain the bounding box of the POI to be displayed based on the POI bounding box acquisition method of any of the foregoing embodiments, which will not be elaborated herein.
[0123] S303. Perform collision detection based on the bounding box of the POI to be displayed to determine whether the POI is displayed in the collision detection result of the electronic map.
[0124] Exemplarily, the application software may input the bounding boxes of the POIs to be displayed into a preset collision detection algorithm to obtain the above-mentioned collision detection result. The collision detection result may be used to characterize which POIs to be displayed can be displayed on the electronic map. Optionally, the collision detection algorithm may be any existing collision detection algorithm, and the present application does not limit this.
[0125] S304. Render the electronic map according to the collision detection result of the POI, map data, and map rendering parameters.
[0126] Among them, the above-mentioned map rendering parameters may include at least one parameter required for rendering the electronic map, such as the scale. It should be understood that the implementation method of the application software for rendering the electronic map according to the collision detection result of the POI, map data, and map rendering parameters may refer to any existing electronic map rendering method, which will not be elaborated herein. For example, after the application software determines to display the POI according to the collision detection result of the POI, it may construct a layout tree for expressing the style of the POI according to the style layout of the POI. Then, the application software may convert the layout tree into a format that the drawing tool can calculate, and use the drawing tool to perform drawing and rendering on the POI based on the above-mentioned map data, map rendering parameters, etc., and then display the POI in the electronic map.
[0127] In this embodiment, after determining the bounding box of the POI to be displayed through the above POI bounding box acquisition method, collision detection can be performed based on the bounding box of the POI to be displayed to obtain the collision detection result of whether the POI is displayed on the electronic map. Since the bounding box reflecting the actual shape of the POI can be obtained through the aforementioned POI bounding box acquisition method, the accuracy of the bounding box of the POI to be displayed is improved. Therefore, the accuracy of performing collision detection based on the bounding box of the POI to be displayed to determine which POIs can be displayed on the electronic map is also improved. Furthermore, the possibility that the POI cannot be displayed due to the inaccurate bounding box of the POI is reduced, the number of POIs that can be displayed on the electronic map is increased, the information loss is reduced, and the user experience is improved.
[0128] Figure 7 It is a schematic flowchart of another map rendering method provided by this application. As Figure 7 shown, the application software can receive the POI style layout sent by the backend. Then, the application software can parse and calculate the style layout, and calculate the bounding box of the POI based on the parsing result (this bounding box may not be a rectangular bounding box, so the bounding box of this POI can also be called a special-shaped bounding box). Specifically, Figure 8 It is a schematic flowchart of another POI bounding box acquisition method provided by this application.
[0129] After obtaining the special-shaped bounding box of the POI through the POI bounding box acquisition method as Figure 8 shown, the special-shaped bounding box of the POI can be input into the collision detection algorithm to determine which POIs can be displayed in this map page through this collision detection algorithm. As Figure 7 shown, after determining the POIs that can be displayed through the collision detection algorithm, a layout tree for expressing the POI style (that is, constructing a layout tree) can be constructed according to the style layout of the POI. Then, the application software can convert the layout tree into a format that the drawing tool can calculate (that is, constructing a rendering node), and use the drawing tool to draw the POI and then display the POI in the above display area in this map page. Among them, Figure 7 The no branch after the display judgment step shown in is used to represent that the application software continuously executes this collision detection algorithm periodically to continue to judge the POIs that can be displayed on the map page through this collision detection algorithm.
[0130] As Figure 8 shown, during the process of obtaining the special-shaped bounding box of the POI, the application software can, for example, split the overall style layout of the POI according to the labels (or called node units) in the layout to implement parsing the style layout of the POI, and then determine at least one node of the POI. For example, Figure 4bNode 1 (which can be the background image of Node 2), Node 2 (which can be the name node of this POI), and Node 3 (which can be the dotted line image texture of this POI). Then, when the bounding box of the display element associated with a child node is within the bounding box of the display element associated with the parent node, the application software can remove the bounding box of the display element associated with the child node and retain the bounding box of the display element associated with the parent node. Then, the application software can convert the bounding boxes of the display elements associated with each node to the set point of interest coordinate system for representation according to the relative positions of the nodes. Through the above method, the layout of the POI is placed in the same coordinate system, and the relative positions of the split rectangular bounding boxes are described in terms of coordinates. When a POI is described by multiple rectangular bounding boxes, it avoids the problem that a rectangle has only width and height and no position information, making it impossible for the rectangular bounding box to accurately describe the overall contour of the POI. For the bounding boxes of the display elements associated with multiple nodes with overlapping regions, the application software can also retain the rectangular bounding box of the display element associated with one of the multiple nodes and remove the overlapping regions from the bounding boxes of the display elements associated with the remaining nodes (i.e., data cleaning) to obtain the positions of the new bounding boxes of the "remaining nodes" in the point of interest coordinate system. Then, the application software can obtain the irregular bounding box (which can also be called the circumscribed bounding box) of this POI based on the positions of the bounding boxes of the display elements associated with the retained nodes in the point of interest coordinate system and the positions of the new bounding boxes of the "remaining nodes" in the point of interest coordinate system. Through the above method, it avoids repeated calculation of overlapping regions during collision detection, improves the efficiency of collision detection calculation, and thus improves the map rendering efficiency.
[0131] As Figure 8 shown, for any POI, the application software can output the positions of the bounding boxes of the display elements associated with each node included in the circumscribed bounding box of this POI in the point of interest coordinate system into the same relative position array to the collision detection algorithm to determine that the relative position relationship of the rectangular bounding boxes of the display elements associated with each node of the same POI remains unchanged.
[0132] In this embodiment, by splitting the overall layout of the POI according to the labels (i.e., nodes) in the layout and obtaining rectangular bounding boxes with relative positions between each node, an overall irregular bounding box is formed, realizing the representation of the bounding box of the POI in the form of an irregular bounding box. Through the above method, on the premise of ensuring computational performance, using the form of an irregular bounding box can more accurately describe the contour of the POI style, realize the stability and accuracy of collision detection, and thus increase the number of POIs that can be displayed on the map page, improving the user experience.
[0133] Figure 9The structural schematic diagram of a point of interest bounding box acquisition device provided for this application. As Figure 9 shown, the device includes: an acquisition module 31 and a processing module 32. Among them,
[0134] The acquisition module 31 is used to acquire the style layout of the point of interest.
[0135] The processing module 32 is used to obtain the bounding box of the to-be-displayed elements associated with the node according to the to-be-displayed elements of the point of interest associated with the node in the style layout; and remove the overlapping areas between the bounding boxes according to the subordination relationship of the nodes in the style layout to obtain the bounding box of the point of interest.
[0136] Taking the subordination relationship as the parent-child relationship as an example, optionally, the processing module 32 is specifically used to generate a style layout tree according to the to-be-displayed elements of the point of interest associated with the node in the style layout; for two nodes with the parent-child relationship, when it is determined based on the style layout that the to-be-displayed elements associated with the child node need to be displayed within the to-be-displayed elements associated with the parent node, remove the bounding box of the to-be-displayed elements associated with the child node; for the bounding boxes of the remaining to-be-displayed elements, in the set point of interest coordinate system, determine and remove the overlapping areas of the bounding boxes of the remaining to-be-displayed elements to obtain the bounding box of the point of interest. Among them, the style layout tree stores the parent-child relationship between the nodes.
[0137] Taking the bounding box of the to-be-displayed element as a rectangular bounding box, and the rectangular bounding box includes length and width as an example, optionally, the processing module 32 is specifically used to obtain the position area covered by the rectangular bounding box of the remaining to-be-displayed elements in the set point of interest coordinate system based on the set point of interest coordinate system and the length and width of the rectangular bounding box of the remaining to-be-displayed elements; determine and remove the overlapping areas between the rectangular bounding boxes of the remaining to-be-displayed elements according to the position area covered by the rectangular bounding box of the remaining to-be-displayed elements in the set point of interest coordinate system to obtain the bounding box of the point of interest.
[0138] Optionally, the position area is represented by the position coordinates of the two diagonal vertices of the rectangular bounding box in the point of interest coordinate system, the horizontal axis and the vertical axis of the point of interest coordinate system are respectively parallel to two mutually perpendicular sides of the rectangular bounding box, and the origin of the point of interest coordinate system coincides with one of the vertices of the rectangular bounding box in the rectangular bounding boxes of the remaining to-be-displayed elements.
[0139] Optionally, the processing module 32 is specifically configured to determine the overlapping area between the rectangular bounding boxes according to the position area covered by the rectangular bounding box of the to-be-displayed element in the point-of-interest coordinate system; delete the position coordinates of the diagonal vertices that constitute the overlapping area in the rectangular bounding box, and determine the bounding box of the point of interest through the position coordinates of the remaining diagonal vertices of the rectangular bounding box.
[0140] The point-of-interest bounding box acquisition device provided by the present application is used to execute the embodiments of the foregoing point-of-interest bounding box acquisition method, and its implementation principle and technical effects are similar, and will not be elaborated here.
[0141] Figure 10 It is a schematic structural diagram of a map rendering device provided by the present application. As Figure 10 shown, the device includes: a first acquisition module 41, a second acquisition module 42, a processing module 43, and a rendering module 44. Among them,
[0142] The first acquisition module 41 is used to acquire map rendering data. Among them, the rendering data includes the style layout of the points of interest to be displayed and map data.
[0143] The second acquisition module 42 is used to acquire the bounding box of the point of interest to be displayed based on the point-of-interest bounding box acquisition method described in any of the foregoing embodiments.
[0144] The processing module 43 is used to perform collision detection according to the bounding box of the point of interest to be displayed to determine the collision detection result of whether the point of interest is displayed on the electronic map.
[0145] The rendering module 44 is used to render the electronic map according to the collision detection result of the point of interest, the map data, and the map rendering parameters.
[0146] The map rendering device provided by the present application is used to execute the embodiments of the foregoing map rendering method, and its implementation principle and technical effects are similar, and will not be elaborated here.
[0147] Figure 11 It is a schematic hardware structure diagram of an electronic device provided by the present application. Exemplarily, the electronic device may be, for example, an electronic device deployed with the foregoing application software. Figure 11 The electronic device 50 shown includes a memory 51, a processor 52, and a communication interface 53. The memory 51, the processor 52, and the communication interface 53 are communicatively connected to each other. For example, the memory 51, the processor 52, and the communication interface 53 may be communicatively connected by means of a network connection. Alternatively, the above electronic device 50 may further include a bus 54. The memory 51, the processor 52, and the communication interface 53 are communicatively connected to each other through the bus 54. Figure 11The electronic device 50 is such that the memory 51, the processor 52, and the communication interface 53 are communicatively connected to each other via the bus 54.
[0148] The memory 51 can be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 51 can store a program. When the program stored in the memory 51 is executed by the processor 52, the processor 52 and the communication interface 53 are used to perform the POI bounding box acquisition and / or the map rendering method described in any of the foregoing embodiments. The memory can also store the data required for the POI bounding box acquisition and / or the map rendering method.
[0149] The processor 52 can be a general-purpose CPU, a microprocessor, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits.
[0150] The processor 52 can also be an integrated circuit chip with signal processing capabilities. In the implementation process, the POI bounding box acquisition and / or the map rendering function of the present application can be completed by the integrated logic circuit in the hardware of the processor 52 or instructions in software form. The above-mentioned processor 52 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments below of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments below of the present application in combination can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 51, and the processor 52 reads the information in the memory 51 and combines its hardware to complete the POI bounding box acquisition and / or the map rendering function of the present application.
[0151] The communication interface 53 uses a transceiver module such as, but not limited to, a transceiver to implement communication between the electronic device 50 and other devices or communication networks. For example, a data set can be obtained through the communication interface 53.
[0152] When the above-mentioned electronic device 50 includes a bus 54, the bus 54 can include a path for transmitting information between various components of the electronic device 50 (for example, the memory 51, the processor 52, and the communication interface 53).
[0153] This application also provides a computer-readable storage medium, which can include: various media that can store program codes, such as USB flash drives, external hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs. Specifically, the computer-readable storage medium stores program instructions, and the program instructions are used for the methods in the above embodiments.
[0154] This application also provides a program product, which includes execution instructions stored in a readable storage medium. At least one processor of the electronic device can read the execution instructions from the readable storage medium, and the execution of the execution instructions by at least one processor enables the electronic device to implement the acquisition of the point-of-interest bounding box and / or the map rendering method provided by the above various embodiments.
[0155] The term "a plurality" in this article refers to two or more. The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after; in a formula, the character " / " represents a "division" relationship between the associated objects before and after. In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0156] It can be understood that the various numerical numbers involved in the embodiments of this application are only for the convenience of description and are not used to limit the scope of the embodiments of this application.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for obtaining an interest point bounding box, characterized in that, The method includes: Obtain the style layout of the point of interest; According to the elements to be displayed of the point of interest associated with the nodes in the style layout, obtain the bounding boxes of the elements to be displayed associated with the nodes; According to the subordinate relationship of the nodes in the style layout, remove the overlapping areas between the bounding boxes to obtain the bounding box of the point of interest.
2. The method according to claim 1, characterized in that, If the subordinate relationship is a parent-child relationship, then the step of removing the overlapping areas between the bounding boxes according to the subordinate relationship of the nodes in the style layout to obtain the bounding box of the point of interest includes: Generate a style layout tree according to the elements to be displayed of the point of interest associated with the nodes in the style layout, and the style layout tree stores the parent-child relationship between the nodes; For two nodes with the parent-child relationship, if it is determined based on the style layout that the elements to be displayed associated with the child node need to be displayed within the elements to be displayed associated with the parent node, then remove the bounding box of the elements to be displayed associated with the child node; For the bounding boxes of the remaining elements to be displayed, in the set coordinate system of the point of interest, determine and remove the overlapping areas of the bounding boxes of the remaining elements to be displayed to obtain the bounding box of the point of interest.
3. The method according to claim 2, characterized in that, The bounding box of the element to be displayed is a rectangular bounding box, and the rectangular bounding box includes a length and a width. The step of determining and removing the overlapping areas of the bounding boxes of the remaining elements to be displayed in the set coordinate system of the point of interest to obtain the bounding box of the point of interest includes: Based on the set coordinate system of the point of interest and the length and width of the rectangular bounding box of the remaining elements to be displayed, obtain the position area covered by the rectangular bounding box of the remaining elements to be displayed in the set coordinate system of the point of interest; According to the position area covered by the rectangular bounding box of the remaining elements to be displayed in the set coordinate system of the point of interest, determine and remove the overlapping areas between the rectangular bounding boxes of the remaining elements to be displayed to obtain the bounding box of the point of interest.
4. The method according to claim 3, characterized in that, The position area is represented by the position coordinates of the two diagonal vertices of the rectangular bounding box in the coordinate system of the point of interest. The horizontal axis and the vertical axis of the coordinate system of the point of interest are respectively parallel to the two mutually perpendicular sides of the rectangular bounding box, and the origin of the coordinate system of the point of interest coincides with one of the vertices of the rectangular bounding box of the remaining elements to be displayed.
5. The method according to claim 4, characterized in that, The step of determining and removing the overlapping areas between the rectangular bounding boxes of the remaining elements to be displayed according to the position area covered by the rectangular bounding box of the remaining elements to be displayed in the set coordinate system of the point of interest to obtain the bounding box of the point of interest includes: Determine the overlapping areas between the rectangular bounding boxes according to the position area covered by the rectangular bounding box of the element to be displayed in the coordinate system of the point of interest; Delete the position coordinates of the diagonal vertices that form the overlapping area in the rectangular bounding box, and determine the bounding box of the point of interest through the position coordinates of the remaining diagonal vertices of the rectangular bounding box.
6. A method for map rendering, characterized in that, The method includes: Obtain map rendering data, where the rendering data includes the style layout of the points of interest to be displayed and map data; Based on the method described in any one of claims 1-5, obtain the bounding box of the point of interest to be displayed; Perform collision detection based on the bounding box of the point of interest to be displayed to determine the collision detection result of whether the point of interest is displayed on the electronic map; Render the electronic map according to the collision detection result of the point of interest, the map data, and the map rendering parameters.
7. An apparatus for obtaining an interest point bounding box, characterized in that, The device includes: An acquisition module for acquiring the style layout of the point of interest; A processing module for obtaining the bounding box of the elements to be displayed associated with the node according to the elements to be displayed of the point of interest associated with the node in the style layout; removing the overlapping areas between the bounding boxes according to the subordinate relationship of the nodes in the style layout to obtain the bounding box of the point of interest.
8. An apparatus for map rendering, characterized in that, The device includes: A first acquisition module for acquiring map rendering data; wherein the rendering data includes the style layout of the point of interest to be displayed and the map data; A second acquisition module for obtaining the bounding box of the point of interest to be displayed based on the method described in any one of claims 1-5; A processing module for performing collision detection based on the bounding box of the point of interest to be displayed to determine the collision detection result of whether the point of interest is displayed on the electronic map; A rendering module for rendering the electronic map according to the collision detection result of the point of interest, the map data, and the map rendering parameters.
9. An electronic device, characterized in that, Includes: A processor and a memory; The processor is communicatively connected to the memory; The memory stores computer instructions; The processor executes the computer instructions stored in the memory to implement the method described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program which, when executed by a processor, implements the method described in any one of claims 1 to 6.