A three-dimensional map mass POI display method, a terminal device and a storage medium
By layering the 3D map and aggregating POIs by section, the display efficiency of the 3D map was optimized, solving the problems of slow loading speed and increased memory usage, and achieving efficient POI display.
Patent Information
- Application Number
- CN202310379117.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-04-11
AI Technical Summary
As the number of Points of Interest (POIs) on 3D maps increases, loading speed slows down and memory requirements increase, which existing technologies struggle to address effectively.
By layering the 3D map and setting the grid according to the layer, the grid coordinates and grid center points of POIs are calculated, POIs are aggregated, an information table is built and stored, and multi-threaded query is used to optimize the display.
The reduction of feature point information on the 3D display screen solves the problems of slow loading speed and increased memory usage, thus improving display efficiency.
Smart Images

Figure CN117009447B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of map display, and in particular to a method, terminal device and storage medium for displaying massive amounts of POIs in a 3D map. Background Technology
[0002] Currently, existing technologies primarily transmit Points of Information (POIs) to 3D map clients for aggregation and display. As 3D maps become more sophisticated, the number of POIs displayed on them is also increasing. However, with the increase in the number of POIs, the loading speed of 3D maps is becoming increasingly slower. Summary of the Invention
[0003] To address the aforementioned issues, this invention proposes a method for displaying massive amounts of POIs in a 3D map, a terminal device, and a storage medium.
[0004] The specific plan is as follows:
[0005] A method for displaying massive amounts of Points of Interest (POIs) in a 3D map includes the following steps:
[0006] S1: Divide the 3D map into layers based on the height value, and set the grid size corresponding to each layer according to the layer.
[0007] S2: Obtain POI data information and calculate the coordinates of each layer of the tiling grid corresponding to each POI and the latitude and longitude of the grid center point corresponding to the tiling grid;
[0008] S3: Traverse each tiling grid of each level, and aggregate the POIs contained in the tiling grid according to the tiling grid coordinates of each POI corresponding to each level to obtain aggregated data information;
[0009] S4: Based on the data information of all POIs, the coordinates of the sub-grids, the latitude and longitude of the grid center point, and the aggregated data information, construct and store the sub-grid information table corresponding to each sub-grid, the sub-grid associated POI information table corresponding to each POI, and the aggregated point information table corresponding to each aggregated point;
[0010] S5: Calculate the corresponding level and the corresponding grid coordinate range based on the height and latitude / longitude range of the 3D map area displayed on the screen;
[0011] S6: Based on the calculated hierarchy and grid coordinate range, query the POI from the three information tables and display the query results on the 3D map.
[0012] Furthermore, the hierarchy is divided according to the following formula:
[0013] levelMaxHeight level =2(level-1) *100
[0014] Where level represents the level, and levelMaxHeight level This indicates the maximum height corresponding to the level.
[0015] Furthermore, the size of the grid for each layer is set according to the following formula:
[0016] gridLevelLength=gridMinLength*2 (level-1)
[0017] gridLevelWidth=gridMinWidth*2 (level-1)
[0018] Where gridLevelLength represents the grid length, gridMinLength represents the minimum grid length, gridLevelWidth represents the grid width, gridMinWidth represents the minimum grid width, and level represents the level.
[0019] Furthermore, the formula for calculating the grid coordinates of a specific layer corresponding to a POI is as follows:
[0020]
[0021]
[0022] Where x represents the x-th grid cell in the length direction of the map, y represents the x-th grid cell in the width direction of the map, lon represents the longitude of the POI, lat represents the latitude of the POI, minlon represents the minimum longitude of the map, and minlat represents the minimum latitude of the map.
[0023] The formula for calculating the latitude and longitude of the grid center point of a certain layer of POI is as follows:
[0024] centerLon=minlon+(x+0.5)*gridLevelLength
[0025] centerLat=minlat+(y+0.5)*gridLevelWidth
[0026] Where centerLon represents the longitude of the grid center point, centerLat represents the latitude of the grid center point, and minlon represents the latitude of the grid center point.
[0027] Furthermore, the process of aggregating POIs contained in a certain tiling grid includes the following steps:
[0028] S301: Determine whether the level corresponding to the tiling grid is greater than the preset maximum level. If so, determine not to perform aggregation and end; otherwise, proceed to S302.
[0029] S302: Determine whether the amount of associated data in the segmented grid is greater than the preset minimum data amount. If yes, proceed to S303; otherwise, do not perform aggregation and end.
[0030] S303: Group all POIs contained in the tiling grid into pairs of POI groups, and calculate the distance between the two POIs in each POI group;
[0031] S304: Calculate the minimum aggregation distance corresponding to the tiled grid: gridLevelMinDist = (gridLevelWidth / showNum) 2 +(gridLevelHeight / showNum) 2
[0032] Where showNum represents the maximum number of POIs displayed in the grid; gridLevelWidth represents the width of the grid; and gridLevelHeight represents the height of the grid.
[0033] S305: Extract each POI group whose distance is less than or equal to the minimum aggregation distance as a group to be aggregated;
[0034] S306: Traverse all data groups to be aggregated to group all POIs contained therein, resulting in multiple aggregation groups, such that the distance between POIs in different aggregation groups is greater than the minimum aggregation distance.
[0035] S307: Traverse each aggregation group and perform deduplication;
[0036] S308: Calculate the coordinates of the center point corresponding to each aggregation group.
[0037] Furthermore, the formula for calculating the coordinates of the center point corresponding to the aggregation group is as follows:
[0038] ggCenterLon=(aggMaxLon-aggMinLon) / 2+aggMinLon
[0039] aggCenterLat=(aggMaxLon-aggMinLat) / 2+aggMinLat
[0040] Wherein, ggCenterLon represents the longitude of the center point corresponding to the aggregation group, aggCenterLat represents the latitude of the center point corresponding to the aggregation group, aggMaxLon and aggMinLon represent the maximum and minimum longitudes among all POIs in the aggregation group, respectively, and aggMaxLat and aggMinLat represent the maximum and minimum latitudes among all POIs in the aggregation group, respectively.
[0041] Furthermore, in step S6, based on the number of data types contained in the POI, a corresponding number of threads are used for querying, with each thread querying one data type.
[0042] Furthermore, the query results include the point type. Depending on the information table to which the query results belong, the point type includes grid center point, data point, and aggregation point. When displayed on a 3D map, if the point type is a data point, it will be displayed according to the data type.
[0043] A three-dimensional map massive POI display terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described above in the embodiments of the present invention.
[0044] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above in the embodiments of the present invention.
[0045] The present invention adopts the above technical solution, which reduces the amount of feature point information displayed on the 3D display screen by dividing and aggregating POI data, and solves the problem of slow display or significant increase in memory caused by the increase of POI information when loading 3D map client. Attached Figure Description
[0046] Figure 1 The diagram shown is a flowchart of Embodiment 1 of the present invention. Detailed Implementation
[0047] To further illustrate the various embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, primarily used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention.
[0048] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.
[0049] Example 1:
[0050] This invention provides a method for displaying a large number of Points of Interest (POIs) in a 3D map, such as... Figure 1 As shown, the method includes the following steps:
[0051] S1: Divide the 3D map into layers based on the height value, and set the grid size corresponding to each layer according to the layer.
[0052] In this embodiment, the hierarchical levels are divided according to the following formula:
[0053] levelMaxHeight level =2 (level-1) *100
[0054] Where level represents the level, and levelMaxHeight level This indicates the maximum height corresponding to the level.
[0055] In this embodiment, the maximum level is set to level=9, and the corresponding maximum height is: [100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600].
[0056] The size of the sectional grid is related to the number of layers, and the size of the sectional grid is different for each layer. In this embodiment, the size of the sectional grid for each layer is set according to the following formula:
[0057] gridLevelLength=gridMinLength*2 (level-1)
[0058] gridLevelWidth=gridMinWidth*2 (level-1)
[0059] Where gridLevelLength represents the grid length, gridMinLength represents the minimum grid length, gridLevelWidth represents the grid width, and gridMinWidth represents the minimum grid width. The length corresponds to the latitude line on the map, and the width corresponds to the longitude line on the map.
[0060] The minimum grid length and minimum grid width need to be set in advance. In this embodiment, they are set as follows: gridMinLength = 0.0000875, gridMinWidth = 0.00004375.
[0061] S2: Obtain POI data information and calculate the coordinates of each layer's grid and the latitude and longitude of the grid center point corresponding to each POI.
[0062] The obtained POI data information includes: data ID (data_id), data type (data_type), longitude (lon), and latitude (lat).
[0063] Each POI has a different grid coordinate at each level. Based on the data information of each POI, its corresponding grid cell can be calculated. In this embodiment, grid cell coordinates (x, y) are used to record the grid cell number, where x corresponds to the length direction of the map and y corresponds to the width direction. The value of x indicates that it is within the x-th grid cell in the length direction of the map, and the value of y indicates that it is within the y-th grid cell in the width direction of the map. The corresponding calculation formula is as follows:
[0064]
[0065]
[0066] Wherein, minlon represents the minimum longitude of the map, and minlat represents the minimum latitude of the map.
[0067] The latitude and longitude of the center point of each grid can be calculated based on its grid coordinates (x, y). The specific calculation formula is as follows:
[0068] centerLon=minlon+(x+0.5)*gridLevelLength
[0069] centerLat=minlat+(y+0.5)*gridLevelWidth
[0070] Where centerLon represents the longitude of the grid center point, centerLat represents the latitude of the grid center point, and minlon represents the latitude of the grid center point.
[0071] S3: Traverse each tiling grid of each level, and aggregate the POIs contained in the tiling grid according to the tiling grid coordinates of each POI corresponding to each level to obtain aggregated data information.
[0072] The process of aggregating POIs contained in a certain tiling grid includes the following steps:
[0073] S301: Determine whether the level corresponding to the tiling grid is greater than the preset maximum level. If so, determine not to perform aggregation and end; otherwise, proceed to S302.
[0074] S302: Determine whether the amount of associated data in the segmented grid is greater than the preset minimum data amount. If yes, proceed to S303; otherwise, do not perform aggregation and end.
[0075] S303: Group all POIs contained in the tiling grid into pairs of POI groups, and calculate the distance between the two POIs in each POI group;
[0076] S304: Calculate the minimum aggregation distance corresponding to the tiled grid: gridLevelMinDist = (gridLevelWidth / showNum) 2 +(gridLevelHeight / showNum) 2
[0077] Where showNum represents the maximum number of POIs displayed in the grid; gridLevelWidth represents the width of the grid; and gridLevelHeight represents the height of the grid.
[0078] S305: Extract each POI group whose distance is less than or equal to the minimum aggregation distance as a group to be aggregated;
[0079] S306: Traverse all data groups to be aggregated to group all POIs contained therein, resulting in multiple aggregation groups, such that the distance between POIs in different aggregation groups is greater than the minimum aggregation distance.
[0080] S307: Traverse each aggregation group and perform deduplication;
[0081] S308: Calculate the coordinates of the center point corresponding to each aggregation group.
[0082] One aggregation group corresponds to one aggregation point. In this embodiment, the formula for calculating the coordinates of the center point corresponding to the aggregation group is:
[0083] ggCenterLon=(aggMaxLon-aggMinLon) / 2+aggMinLon
[0084] aggCenterLat=(aggMaxLon-aggMinLat) / 2+aggMinLat
[0085] Wherein, ggCenterLon represents the longitude of the center point corresponding to the aggregation group, aggCenterLat represents the latitude of the center point corresponding to the aggregation group, aggMaxLon and aggMinLon represent the maximum and minimum longitudes among all POIs in the aggregation group, respectively, and aggMaxLat and aggMinLat represent the maximum and minimum latitudes among all POIs in the aggregation group, respectively.
[0086] The maximum level, minimum data volume, maximum number of POIs displayed in the grid, and minimum aggregation distance can be set by those skilled in the art based on their experience, and are not limited here.
[0087] During the traversal in step S406, it can be determined whether the poi is already in the aggregation group. If so, other poi associated with the poi (i.e., those with a distance less than the minimum aggregation distance) are also added to the aggregation group; otherwise, they are added to a new aggregation group.
[0088] S4: Based on the data information of all POIs, the coordinates of the subdivided grids, the latitude and longitude of the grid center point, and the aggregated data information, construct and store the subdivided grid information table corresponding to each subdivided grid, the subdivided grid-related POI information table corresponding to each POI, and the aggregated point information table corresponding to each aggregated point.
[0089] The contents of the three information tables in this embodiment are shown below:
[0090] (1) The information table of the grating includes: grating number, level, grating coordinates (x, y), data type, associated data volume (i.e., the number of POIs contained in the grating), whether it is aggregated, and the latitude and longitude of the grating center point.
[0091] (2) The POI information table associated with the sectional grid includes: association number, associated sectional grid number, associated POI data number, data type, and level.
[0092] (3) The aggregation point information table includes: aggregation number, associated grid number, level, center point coordinates, number of aggregations, and a list of associated numbers of POIs contained in the aggregation point.
[0093] S5: Calculate the corresponding level and the corresponding grid coordinate range based on the height and latitude / longitude range of the 3D map area displayed on the screen.
[0094] The three information tables mentioned above can be stored on the server. When each user's client (web client or desktop client) needs to display the 3D map, it is also necessary to enable TCP or WebSocket listening and connect to TCP or WebSocket.
[0095] The height and latitude / longitude range of a 3D map area can be obtained using existing algorithms. For example, based on the screen coordinates of four points on the screen, a 3D ray collision algorithm can be used to find the intersection of the ray and the scene, and obtain the latitude / longitude coordinates of the first intersection point, thus showing the latitude / longitude range and height of the 3D map area displayed on the screen.
[0096] Based on the obtained height value and the layering method in step S1, the corresponding layer can be obtained.
[0097] The following formula can be used to obtain the coordinate range of the grid based on the latitude and longitude range.
[0098]
[0099]
[0100]
[0101]
[0102] Wherein, min_x and max_x represent the minimum and maximum x-coordinates of the grid, respectively; min_y and max_y represent the minimum and maximum y-coordinates of the grid, respectively; params.minlon and params.maxLon represent the minimum and maximum longitudes of the 3D map area displayed on the screen, respectively; and params.minLat and params.minLat represent the minimum and maximum latitudes of the 3D map area displayed on the screen, respectively.
[0103] S6: Based on the calculated hierarchy and grid coordinate range, query the POI from the three information tables and display the query results on the 3D map.
[0104] To speed up the query process, this embodiment uses a corresponding number of threads to perform queries based on the number of data types contained in the POI, with each thread querying one data type.
[0105] In this embodiment, the query results are set to include: data type, point type (including grid center point, data point and aggregation point), latitude and longitude of POI, POI data number (valid when the point type is data point), and data quantity (value is 1 when the point type is data point, and aggregate or grid quantity when the point type is other).
[0106] Furthermore, the query results include the point type. The point type varies depending on the information table to which the query results belong: the grid center point in the sectional grid information table, the data point in the sectional grid associated POI information table, and the aggregation point information table, the aggregation point. When displayed on a 3D map, if the point type is a data point, it will be displayed according to the data type.
[0107] This invention reduces the amount of feature point information displayed on the 3D display screen by dividing and aggregating POI data, thus solving the problem of slow display or significant memory increase caused by the increase of POI information when loading 3D map clients.
[0108] Example 2:
[0109] The present invention also provides a three-dimensional map massive POI display terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above-described method embodiment of Embodiment 1 of the present invention.
[0110] Furthermore, as an executable solution, the 3D map massive POI display terminal device can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The 3D map massive POI display terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above-described composition of the 3D map massive POI display terminal device is merely an example and does not constitute a limitation on the 3D map massive POI display terminal device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the 3D map massive POI display terminal device may also include input / output devices, network access devices, buses, etc., and this embodiment of the invention does not limit this.
[0111] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the 3D map massive POI display terminal device, connecting all parts of the device via various interfaces and lines.
[0112] The memory can be used to store the computer programs and / or modules. The processor, by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory, realizes various functions of the 3D map massive POI display terminal device. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0113] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in the embodiments of the present invention.
[0114] If the modules / units integrated in the 3D map massive POI display terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.
[0115] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.
Claims
1. A method for displaying mass POIs of a three-dimensional map, characterized by, The method comprises the following steps: S1: stratifying the three-dimensional map according to the height value, and setting the size of the corresponding graticule grid of each layer according to the level; S2: obtaining POI data information, and calculating the graticule grid coordinates of each POI corresponding to each layer and the grid center point longitude and latitude corresponding to the graticule grid; S3: traversing each graticule grid of each level, aggregating the POIs contained in the graticule grid according to the graticule grid coordinates of each POI corresponding to each layer, and obtaining aggregation data information; S4: based on the data information of all POIs, the graticule grid coordinates, the grid center point longitude and latitude, and the aggregation data information, constructing and storing the graticule grid information table corresponding to each graticule grid, the graticule grid associated POI information table corresponding to each POI, and the aggregation point information table corresponding to each aggregation point; S5: calculating the corresponding level and the corresponding graticule grid coordinate range according to the height and the longitude and latitude range of the screen display three-dimensional map region; S6: querying the POI from the three information tables based on the calculated level and graticule grid coordinate range, and displaying the query result on the three-dimensional map; The process of aggregating the POIs contained in a graticule grid comprises the following steps: S301: determining whether the level corresponding to the graticule grid is greater than a preset maximum level, if yes, determining not to aggregate, and ending; otherwise, entering S302; S302: determining whether the associated data amount of the graticule grid is greater than a preset minimum data amount, if yes, entering S303; otherwise, not aggregating, and ending; S303: grouping all POIs contained in the graticule grid into POI groups two by two, and calculating the distance between two POIs in each POI group; S304: calculating the minimum aggregation distance gridLevelMinDist corresponding to the graticule grid: gridLevelMinDist = (gridLevelWidth / showNum) 2 + (gridLevelHeight / showNum) 2 Wherein, showNum represents the maximum display number of POIs in the graticule grid; gridLevelWidth represents the width of the graticule grid; and gridLevelHeight represents the height of the graticule grid; S305: extracting each POI group with a distance less than or equal to the minimum aggregation distance as a to-be-aggregated group; S306: traversing all to-be-aggregated data groups to group all POIs contained therein, to obtain a plurality of aggregation groups, so that the distance between POIs in different aggregation groups is greater than the minimum aggregation distance; S307: traversing each aggregation group to perform deduplication processing; S308: calculating the center point coordinates corresponding to each aggregation group.
2. The three-dimensional map mass POI display method of claim 1, wherein: The level is divided according to the following formula during stratification: levelMaxHeight level = 2 (level-1) * 100 wherein level represents the level, levelMaxHeight level represents the maximum height corresponding to the level.
3. The method of claim 1, wherein: The size of the graticule grid corresponding to each layer is set according to the following formula: gridLevelLength = gridMinLength * 2 (level-1) gridLevelWidth = gridMinWidth * 2 (level-1) Wherein, gridLevelLength represents the graticule grid length, gridMinLength represents the minimum graticule grid length, gridLevelWidth represents the graticule grid width, gridMinWidth represents the minimum graticule grid width, and level represents the level.
4. The method of claim 3, wherein: The calculation formula of the graticule grid coordinates of a POI corresponding to a layer is: Wherein, x represents the POI is in the length direction of the map xth gridding grid, y represents the POI is in the width direction of the map yth gridding grid, lon represents the longitude of the POI, lat represents the latitude of the POI, minlon represents the minimum longitude of the map, and minlat represents the minimum latitude of the map. The calculation formula of the grid center point longitude and latitude of the gridding grid corresponding to the POI of a layer is as follows: centerLon=minlon+(x+0.5)*gridLevelLength centerLat=minlat+(y+0.5)*gridLevelWidth Wherein, centerLon represents the grid center point longitude, and centerLat represents the grid center point latitude.
5. The method of claim 1, wherein: The calculation formula of the center point coordinates corresponding to the aggregation group is as follows: ggCenterLon=(aggMaxLon-aggMinLon) / 2+aggMinLon aggCenterLat=(aggMaxLat-aggMinLat) / 2+aggMinLat Wherein, ggCenterLon represents the longitude of the center point corresponding to the aggregation group, aggCenterLat represents the latitude of the center point corresponding to the aggregation group, aggMaxLon and aggMinLon respectively represent the maximum longitude and the minimum longitude in all POIs of the aggregation group, and aggMaxLat and aggMinLat respectively represent the maximum latitude and the minimum latitude in all POIs of the aggregation group.
6. The method of claim 1, wherein: In step S6, according to the number of data types contained by the POI, a corresponding number of threads are used for querying, and each thread queries one data type.
7. The method of claim 1, wherein the three-dimensional map mass POI display method is characterized by: The content of the query result includes point type, and according to the difference of the information table to which the query result belongs, the point type includes grid center point, data point and aggregation point, and when displayed on a three-dimensional map, when the point type is a data point, the data type is displayed according to the data type.
8. A three-dimensional map mass POI display terminal device, characterized by: The computer program is executed by the processor to realize the steps of the method of any one of claims 1-7.
9. A computer readable storage medium storing a computer program, characterized in that: The computer program is executed by the processor to realize the steps of the method of any one of claims 1-7.
Citation Information
Patent Citations
Method for realizing gathering and scattering visualization of mass ground object mark points through layered grid division
CN109977179A
Systems and methods for identifying grids of geographical region in map
US20200279170A1