CN115374229A - Map data processing method and device, electronic equipment and storage medium - Google Patents
Map data processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115374229A CN115374229A CN202211010971.5A CN202211010971A CN115374229A CN 115374229 A CN115374229 A CN 115374229A CN 202211010971 A CN202211010971 A CN 202211010971A CN 115374229 A CN115374229 A CN 115374229A
- Authority
- CN
- China
- Prior art keywords
- grid
- node
- map
- level
- polymerizable
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
- G06F16/24554—Unary operations; Data partitioning operations
- G06F16/24556—Aggregation; Duplicate elimination
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Remote Sensing (AREA)
- Processing Or Creating Images (AREA)
Abstract
The application provides a map data processing method, a map data processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining the distance between each grid node in the first-level grid of the map and the visual angle position; determining whether each grid node is a polymerizable node or not according to the distance between each grid node in the first-level grid and the view angle position; if yes, displaying a target aggregation point on the position of the polymerizable node on the map; if not, acquiring each grid sub-node of the grid nodes, displaying a target aggregation point or acquiring the next-level grid sub-node of the grid sub-nodes according to the distance between the grid sub-node and the visual angle position, and executing the step in a circulating manner until the current grid node is the last-level grid sub-node. The method and the device can calculate the aggregation content by judging the distance from the grid node to the visual angle position, can reduce the calculation pressure, reduce the performance loss of a computer and avoid the problem of pause in the rendering process.
Description
Technical Field
The present application relates to the field of map point aggregation, and in particular, to a map data processing method and apparatus, an electronic device, and a storage medium.
Background
When a map-based service is implemented, when too many interest points need to be displayed on a map, complete service data is displayed on a large scale and aggregated data is displayed on a small scale based on the consideration of a drawing effect and rendering performance. When processing interest points with different quantities and different distribution forms, more and more attention is paid to how to obtain more reasonable aggregation effect through an algorithm.
In the prior art, when performing real-time point aggregation, all points on a map need to be traversed again continuously, all the points on the map are calculated in real time to obtain point aggregation contents, and the calculated point aggregation contents are displayed.
Disclosure of Invention
An object of the present invention is to provide a map data processing method, apparatus, electronic device, and storage medium, which improve the efficiency of computing point aggregation, in view of the above-described deficiencies in the prior art.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a map data processing method, where the method includes:
acquiring a current view angle position in a map;
determining the distance between each grid node in a first-level grid of the map and the visual angle position, wherein the map is divided into multiple levels of grids in advance, and each level of grid comprises at least one grid node;
determining whether each grid node is a polymerizable node according to the distance between each grid node in the first-level grid and the visual angle position;
if yes, displaying a target aggregation point on the position of the polymerizable node on the map, wherein the target aggregation point is an aggregation point corresponding to the polymerizable node;
if not, acquiring each grid sub-node of the grid nodes, displaying a target aggregation point or acquiring a next-stage grid sub-node of the grid sub-node according to the distance between the grid sub-node and the visual angle position, circularly executing the step until the current grid node is the last-stage grid sub-node, and displaying the position information corresponding to the current grid node.
Optionally, determining whether each grid node is a polymerizable node according to a distance between each grid node in the first-level grid and the view position, including:
determining whether the distance between the center of the grid node and the visual angle position is greater than the boundary distance corresponding to the grid node;
if so, determining that the grid node is a polymerizable node, otherwise, determining that the grid node is not a polymerizable node.
Optionally, determining whether the grid node is a polymerizable node according to the distance between each grid node in the first-level grid and the view position, further includes:
determining the visual angle gradient corresponding to the grid node according to the visual angle position and the central position of the grid node;
and determining the boundary distance corresponding to the grid nodes according to the point data density coefficient corresponding to the grid nodes, the areas of the grid nodes and the visual angle gradient corresponding to the grid nodes.
Optionally, displaying the target aggregation point on the position of the polymerizable node on the map includes:
determining an aggregate location of the polymerizable node on the map, the aggregate location comprising: the center position of the polymerizable node on the map or the position of a weighted average point of the polymerizable node on the map;
displaying the target aggregation point on the aggregation location.
Optionally, before acquiring the current view angle position in the map, the method further includes:
acquiring a plurality of point data in a map;
and constructing a grid pyramid according to the plurality of point data to obtain a plurality of levels of grids, wherein each level of grid comprises at least one grid node.
Optionally, the constructing a grid pyramid according to the plurality of point data to obtain a multi-level grid includes:
calculating the outer bounding boxes of the plurality of point data to obtain a first geographical boundary rectangle of the plurality of point data;
uniformly dividing the first geographical boundary rectangle to obtain a plurality of grid nodes in a first-level grid;
and recursively dividing each grid node in the first-level grid one by one to obtain the multi-level grid.
Optionally, the recursively dividing the mesh nodes in the first-level mesh one by one to obtain the multi-level mesh includes:
and recursively dividing each grid node in the first-level grid one by one according to the number of preset grid point data and the preset grid area until the number of the point data in each divided grid node is smaller than the number of the preset grid point data or the grid area of each divided grid node is smaller than the preset grid area, so as to obtain the multi-level grid.
In a second aspect, an embodiment of the present application further provides a map data processing apparatus, where the apparatus includes:
the acquisition module is used for acquiring the current view angle position in the map;
the determining module is used for determining the distance between each grid node in a first-level grid of the map and the visual angle position, wherein the map is divided into multiple levels of grids in advance, and each level of grid comprises at least one grid node;
the determining module is used for determining whether each grid node is a polymerizable node according to the distance between each grid node in the first-level grid and the visual angle position;
if yes, a display module is used for displaying a target aggregation point on the position of the polymerizable node on the map, wherein the target aggregation point is an aggregation point corresponding to the polymerizable node;
if not, the acquisition module is used for acquiring each grid sub-node of the grid nodes, displaying a target aggregation point or acquiring a next-level grid sub-node of the grid sub-node according to the distance between the grid sub-node and the visual angle position, executing the step in a circulating manner until the current grid node is the last-level grid sub-node, and displaying the position information corresponding to the current grid node.
Optionally, the determining module is specifically configured to:
determining whether the distance between the center of the grid node and the visual angle position is greater than the boundary distance corresponding to the grid node;
if so, determining that the grid node is a polymerizable node, otherwise, determining that the grid node is not a polymerizable node.
Optionally, the determining module is specifically configured to:
determining the visual angle gradient corresponding to the grid node according to the visual angle position and the central position of the grid node;
and determining the boundary distance corresponding to the grid nodes according to the point data density coefficient corresponding to the grid nodes, the areas of the grid nodes and the visual angle gradient corresponding to the grid nodes.
Optionally, the display module is specifically configured to:
determining an aggregate location of the polymerizable node on the map, the aggregate location comprising: the center position of the polymerizable node on the map or the position of a weighted average point of the polymerizable node on the map;
displaying the target aggregation point on the aggregation location.
Optionally, the obtaining module is specifically configured to:
acquiring a plurality of point data in a map;
and constructing a grid pyramid according to the plurality of point data to obtain a plurality of levels of grids, wherein each level of grid comprises at least one grid node.
Optionally, the obtaining module is specifically configured to:
calculating an outer bounding box of the plurality of point data to obtain a first geographical boundary rectangle of the plurality of point data;
uniformly dividing the first geographical boundary rectangle to obtain a plurality of grid nodes in a first-level grid;
and recursively dividing each grid node in the first-level grid one by one to obtain the multi-level grid.
Optionally, the obtaining module is specifically configured to:
and recursively dividing each grid node in the first-level grid one by one according to the number of preset grid point data and the preset grid area until the number of the point data in each divided grid node is smaller than the number of the preset grid point data or the grid area of each divided grid node is smaller than the preset grid area, so as to obtain the multi-level grid.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, when an application program runs, the processor and the storage medium communicate with each other through the bus, and the processor executes the program instructions to execute the steps of the map data processing method according to the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program is read and executes the steps of the map data processing method according to the first aspect.
The beneficial effect of this application is:
according to the map data processing method, the map data processing device, the electronic equipment and the storage medium, the current view angle position in the map is obtained; determining the distance between each grid node in a first-level grid of the map and the visual angle position, wherein the map is divided into multiple levels of grids in advance, and each level of grid comprises at least one grid node; determining whether each grid node is a polymerizable node or not according to the distance between each grid node in the first-level grid and the view angle position; if yes, displaying a target aggregation point on the position of the polymerizable node on the map, wherein the target aggregation point is an aggregation point corresponding to the polymerizable node; if not, acquiring each grid sub-node of the grid nodes, displaying a target aggregation point or acquiring a next-stage grid sub-node of the grid sub-node according to the distance between the grid sub-node and the visual angle position, circularly executing the step until the current grid node is the last-stage grid sub-node, and displaying the position information corresponding to the current grid node. The distance between each grid node and the visual angle position is judged to determine the display target aggregation point or obtain the next-level grid sub-node of the grid node, so that the judgment of the distance between the grid node and the visual angle position is realized, the aggregation content is calculated without traversing all points on a map, the calculation pressure can be reduced, the performance loss of a computer is reduced, and the problem of blockage in the rendering process is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a map data processing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of constructing a grid pyramid according to an embodiment of the present application;
FIG. 3 is a complete schematic diagram of a map data processing method provided in the present application;
fig. 4 is a schematic device diagram of a map data processing method according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
The real-time point aggregation is a dynamic process of continuously updating aggregation points along with the change of visual angles, and the problem to be solved by the application is how to improve the map rendering performance when massive points are aggregated in real time. In the process of map rendering, because the position of each frame of view angle changes, the corresponding aggregation effect of the map under each frame of view angle also needs to be updated in real time, and then the map rendering refers to a process of calculating point aggregation content in real time according to the change of the view angle and displaying the calculated point aggregation content.
In the prior art, two methods are generally used for calculating point aggregation content, one method is to arbitrarily select a preset number of point data from point data sets in a map as initial clustering centroids, and for the rest other point data, the point data are assigned to the clustering centroids most similar to the point data according to the similarity (generally, distance) between the point data and the clustering centroids; after the steps, each clustering centroid has a corresponding data cluster, and then a new clustering centroid is calculated according to the data cluster of each clustering centroid; and continuously and iteratively calculating the clustering mass center as an aggregation point.
However, the clustering centroid points calculated by the method are large in calculation amount and consume computer performance due to multiple iterative calculations, especially when massive points are aggregated in real time, the change of the viewing angle needs to be recalculated every time, page updating delay is easily caused, and the larger the point data amount is, the more the jamming is easily caused.
The other method is to select clustering centroids based on screen range grid division, specifically to use a direct grid algorithm, a grid centroid merging algorithm and the like, wherein the direct grid algorithm divides a map into a plurality of grids, and an aggregation point is displayed at the center of each grid; the grid centroid merging algorithm takes the grid centroid as the position of the aggregation point, and meanwhile, the aggregation points with short distances are merged to avoid serious collision coverage.
However, in another method, when the aggregation state is updated in real time, all points need to be traversed to find the grid point where the aggregation point is located, when the data size is large, a large amount of real-time calculation is involved, the calculation pressure is large, the map rendering efficiency is low, and the performance of a computer is affected.
Fig. 1 is a schematic flowchart of a map data processing method according to an embodiment of the present application, as shown in fig. 1, where the method includes:
and S101, acquiring the current view angle position in the map.
The view position is a view angle of a ground surface on a overlook map when the map is displayed, and the view position may include a geographic coordinate position of the view angle in a spatial geography, and may also include information such as a view angle direction at the view position.
S102, determining the distance between each grid node in the first-level grid of the map and the visual angle position.
The map can be divided into multi-level grids in advance, each level of grid comprises at least one grid node, and the upper and lower levels of relation also exist between each level of grids.
Optionally, after the view angle position is obtained, a preset distance calculation mode may be used to determine a distance between each grid node in the first-level grid and the view angle position, and the distances from each grid node to the view angle position may be the same or different.
S103, determining whether the grid nodes are polymerizable nodes according to the distance between each grid node in the first-level grid and the visual angle position, if so, executing the following step S104, and if not, executing the following step S105.
The aggregation node may indicate that the grid node is a node capable of directly showing an aggregation point, specifically, one aggregation point may be used to show point data information in the grid node, and information such as the number of the point data in the grid node, the area of the grid node, the grid number and the like may be marked and displayed on the aggregation point.
Optionally, a preset method is used to determine whether each grid node is a polymerizable node according to the distance between each grid node in the first-level grid and the view angle position.
And S104, if the grid nodes are the polymerizable nodes, displaying the target polymerization points on the positions of the polymerizable nodes on the map.
The target aggregation point is an aggregation point corresponding to the polymerizable node, and the target aggregation point may be an aggregation point calculated by using a preset method through point data in the polymerizable node; for example, the aggregation point may be an aggregation point representing all the point data in the aggregation node, and may be represented by using a red identification point, for example, information such as the number of all the point data in the aggregation node may be marked on the aggregation point; the aggregation point may also be an identifier of all the point data in the aggregation node, for example, if there is 6 point data in the aggregation node, the target aggregation point may be a point identified by 6 red points.
S105, if the grid node is not the polymerizable node, acquiring each grid sub-node of the grid node, displaying a target polymerization point or acquiring a next-stage grid sub-node of the grid node according to the distance between the grid sub-node and the view angle position, circularly executing the step until the current grid node is the last-stage grid sub-node, and displaying the position information corresponding to the current grid node.
Wherein the step indicates a step of acquiring each mesh sub-node of the mesh node if the mesh node is not a polymerizable node, and displaying a target aggregation point or acquiring a next-stage mesh sub-node of the mesh node according to a distance between the mesh sub-node and the viewpoint position.
Optionally, after obtaining each grid sub-node of the grid node, determining whether each grid sub-node is a polymerizable node according to a distance between each grid sub-node and the view angle position, if the grid sub-node is a polymerizable node, displaying a target polymerization point by the grid sub-node, and if the grid sub-node is not a polymerizable node, continuously obtaining a next-stage grid sub-node of the grid sub-node. Repeatedly executing the steps, and judging whether the grid sub-node is a polymerizable node after each grid node is obtained, namely judging whether the grid sub-node needs to continuously excavate a next-stage grid sub-node of the grid sub-node; if the obtained grid sub-node is a polymerizable node, the grid sub-node does not need to continue to excavate the grid sub-node of the next level downwards at the moment, and the target aggregation point of the grid sub-node is directly displayed; if the obtained grid sub-node is not a polymerizable point, that is, the grid sub-node needs to continue to excavate the grid sub-node of the next level downwards, the next level grid sub-node of the grid sub-node can be obtained by reading the attribute of the grid sub-node until the obtained current grid node is the last level sub-node, and at this time, the next level grid sub-node stops being continuously excavated downwards and the real position information contained in the obtained last level grid node is displayed.
In this embodiment, the distance between each grid node and the view angle position is determined to determine the display target aggregation point or obtain the next-level grid sub-node of the grid node, so that the grid node can be determined to the view angle position only by way of example, and the aggregation content does not need to be calculated by traversing all points on the map, thereby reducing the calculation pressure, reducing the performance loss of the computer, and avoiding the pause problem in the rendering process.
Optionally, the determining, in step S103, whether a mesh node is a polymerizable node according to a distance between each mesh node in the first-level mesh and the view angle position may include:
optionally, it is determined whether the distance between the center of the grid node and the view angle position is greater than the boundary distance corresponding to the grid node, specifically, the coordinate information of the center position of the grid node may be determined first, and the distance between the grid node and the view angle position may be calculated according to the coordinate of the center position of the grid node and the coordinate of the view angle position.
Optionally, if the distance between the center of the grid node and the view angle position is greater than the boundary distance corresponding to the grid node, the grid node is a polymerizable node; and if the distance between the center of the grid node and the visual angle position is smaller than the boundary distance corresponding to the grid node, the grid node is not a polymerizable node.
Optionally, the determining, in step S103, whether a mesh node is a polymerizable node according to a distance between each mesh node in the first-level mesh and the view angle position may include:
optionally, the view angle inclination corresponding to the grid node is determined according to the view angle position and the center position of the grid node, where the view angle inclination is the view angle inclination from the view angle position to the grid node, for example, the view angle inclination may be a view angle inclination of different values, such as 30 °, 45 °, 60 °, 75 °. Specifically, the view angle gradient corresponding to the grid node may be determined by calculation from the coordinates of the view angle position and the coordinates of the center position of the grid node, and the view angle gradient may be, for example, P view To indicate.
Optionally, the boundary distance corresponding to the grid node is determined according to the point data density coefficient corresponding to the grid node, the area of the grid node, and the visual angle gradient corresponding to the grid node.
The point data density coefficient corresponding to the grid node can indicate the density degree or the sparseness degree of the point data contained in the grid node and can be represented by data between 0 and 1, wherein the larger the numerical value is, the denser the point data corresponding to the grid node is, and the smaller the numerical value is, the sparseness of the point data corresponding to the grid node is; the point data dense coefficients corresponding to the grid nodes may be represented using C.
Alternatively, the area of the grid node may use S node To express, the area of the mesh node may be calculated in advance by a preset method.
Optionally, the boundary distance corresponding to the grid node is determined by using a formula (one), where the formula (one) is as follows:
wherein D is the boundary distance corresponding to the grid node, C is the point data density coefficient corresponding to the grid node, S node Is the area of a mesh node, P view The view angle gradient corresponding to the grid node. The boundary distances calculated according to the formula (one) are not uniform for all grid nodes, and meanwhile, whether the grid node is a polymerizable point or not is determined according to the boundary distance corresponding to each grid node and the distance from the grid node to the visual angle position, so that point aggregation information of each grid node can be displayed more flexibly.
In this embodiment, by calculating the boundary distance corresponding to each grid node, the obtained boundary distances may not be uniform for each grid node, so that the aggregation information of the point data of each grid node displayed according to the boundary distance of each grid node is also different, and each grid node may flexibly display the point aggregation information of each grid node.
Optionally, if the grid node is a polymerizable node in S104, displaying the target polymerization point on the position of the polymerizable node on the map may include:
optionally, an aggregate location of the polymerizable node on the map is determined, wherein the aggregate location may include a center location of the polymerizable node on the map or a weighted average point location of the polymerizable node on the map.
Alternatively, the center position of the polymerizable node on the map indicates the position coordinates of the average center of all the point data in the polymerizable node on the map, and specifically, the average value of the coordinates of the respective point data in the polymerizable node may be calculated, and the calculated average value of the coordinates may be used as the position coordinates of the average center of the polymerizable node on the map.
Optionally, the position of the weightable average point on the map of the polymerizable node indicates the weightable average point calculated under the weight of each point data, that is, the weighting value of each point data in the polymerizable node is considered when calculating the weightable average point, wherein if the point data is more important, the weighting value is higher, the position of the obtained weightable average point is closer to the point with the higher weighting value, and specifically, a weighted average algorithm may be used to obtain the position coordinate of the weightable average point.
Optionally, the target aggregation point is displayed on the aggregation position. And if the aggregation position is determined to be the center position of the polymerizable node, displaying a target aggregation point at the center position of the polymerizable node.
In this embodiment, the point aggregation position of the polymerizable node can be displayed more accurately by displaying the target aggregation point in the weighted average point position of the polymerizable node.
Optionally, before acquiring the current view angle position in the map in S101, the method may further include:
optionally, a plurality of point data in the map are obtained. The multiple point data may be position coordinates of each point data in the map, the obtained multiple point data may be cleaned, specifically, the point data exceeding the preset range coordinates may be removed, and the remaining point data may be removed as new multiple point data.
Optionally, a grid pyramid is constructed according to the plurality of point data to obtain a multi-level grid, where each level grid includes at least one grid node. The point data is the new point data, and a preset method can be adopted for the new point data to construct a grid pyramid.
Fig. 2 is a schematic diagram of constructing a grid pyramid according to an embodiment of the present application, and as shown in fig. 2, the constructing a grid pyramid according to multiple point data to obtain a multi-level grid may include:
optionally, an outer bounding box of the plurality of point data is calculated to obtain a first geographical boundary rectangle of the plurality of point data. The outer bounding box may indicate coordinates of a corner of a minimum rectangle that encloses the plurality of pieces of data, and a preset method may be used to obtain a first geographical boundary rectangle of the plurality of pieces of data according to the coordinates of each corner, as shown in the left diagram of fig. 2, which is a schematic diagram of the outer bounding box of the plurality of pieces of data.
Optionally, the first geographical boundary rectangle is uniformly divided to obtain a plurality of grid nodes in the first-level grid, specifically, the first geographical boundary rectangle may be uniformly divided into four grid nodes, and the four grid nodes may be R respectively 1 、R 2 、R 3 、R 4 Then, the first geographic boundary rectangle may be a first-level mesh, and the four divided meshes are four mesh nodes in the first-level mesh, as shown in the right-side diagram of fig. 2, which is a schematic diagram of dividing meshes.
Optionally, each mesh node in the first-level mesh is recursively divided one by one to obtain a multi-level mesh. For the mesh node R as shown in the right graph of FIG. 2 3 Then carrying out recursive division to obtain four grid nodes which are respectively R 31 、R 32 、R 33 、R 34 Then the four grid nodes are R 3 The next level of mesh.
Optionally, the recursively dividing the mesh nodes in the first-level mesh one by one to obtain a multi-level mesh may include:
and recursively dividing each grid node in the first-level grid one by one according to the number of preset grid point data and the preset grid area until the number of the point data in each divided grid node is smaller than the number of the preset grid point data or the grid area of each divided grid node is smaller than the preset grid area, so as to obtain the multi-level grid.
Optionally, if the number of the divided point data in each grid node is less than the number of the preset grid point data, the division is not continued, and each grid node is used as a last-stage grid; and if the grid area of each divided grid node is smaller than the preset grid area, each grid node is not divided any more, and each grid node is used as the last-stage grid. And if any one of the conditions occurs, the grid nodes are not divided.
Illustratively, the number of the predetermined grid point data may be, for example, 11, 10, 9, etc., and the predetermined grid area may be, for example, 2000m × 2000m.
Fig. 3 is a complete schematic diagram of a map data processing method provided in the present application, and as shown in fig. 3, after a plurality of point data in a map are acquired, the data are cleaned and reconstructed, the reconstructed new point data are put into sub-thread processing, and then a grid pyramid is constructed according to the plurality of point data: setting a threshold value, wherein the threshold value can comprise the number of preset grid point data and the area of a preset grid; a process of calculating a first layer of grid, namely calculating an outer bounding box of the plurality of point data, and uniformly dividing the first layer of grid into four grids; continuing to divide downwards to construct a grid pyramid, wherein the process is a process of recursively dividing each grid node of the first-layer grid one by one according to a set threshold; and finishing the pyramid construction, and returning to the main thread, wherein the process is that when the set threshold is reached during grid division, the division is stopped, the sub-threads are quitted, and the main thread is returned. After the grid pyramid is constructed, real-time point aggregation can be performed, and boundary distances are determined firstly in the real-time point aggregation process, wherein the boundary distances are boundary distances corresponding to grid nodes; calculating aggregation points in real time, wherein the process is a process of determining whether each grid node is an aggregation node according to the distance from each grid node to the visual angle position and the boundary distance; and then plotting the aggregate or real points.
It should be noted that, the above processes are all described in detail in the foregoing specification, and are not described herein again.
Fig. 4 is a schematic diagram of an apparatus for a map data processing method according to an embodiment of the present application, and as shown in fig. 4, the apparatus includes:
an obtaining module 201, configured to obtain a current view angle position in a map;
a determining module 202, configured to determine a distance between each grid node in a first-level grid of the map and the view position, where the map is pre-divided into multiple levels of grids, and each level of grid includes at least one grid node;
a determining module 202, configured to determine whether each grid node in the first-level grid is a polymerizable node according to a distance between the grid node and the view position;
if yes, a display module 203, configured to display a target aggregation point on the map at the position where the polymerizable node is located, where the target aggregation point is an aggregation point corresponding to the polymerizable node;
if not, the obtaining module 201 is configured to obtain each grid sub-node of the grid nodes, display a target aggregation point or obtain a next-level grid sub-node of the grid sub-node according to a distance between the grid sub-node and the view angle position, execute the step in a loop until the current grid node is the last-level grid sub-node, and display position information corresponding to the current grid node.
Optionally, the determining module 202 is specifically configured to:
determining whether the distance between the center of the grid node and the visual angle position is greater than the boundary distance corresponding to the grid node;
if so, determining that the grid node is a polymerizable node, otherwise, determining that the grid node is not a polymerizable node.
Optionally, the determining module 202 is specifically configured to:
determining the visual angle gradient corresponding to the grid node according to the visual angle position and the central position of the grid node;
and determining the boundary distance corresponding to the grid nodes according to the point data density coefficient corresponding to the grid nodes, the areas of the grid nodes and the visual angle gradient corresponding to the grid nodes.
Optionally, the display module 203 is specifically configured to:
determining an aggregate location of the polymerizable node on the map, the aggregate location comprising: the center position of the polymerizable node on the map or the position of a weighted average point of the polymerizable node on the map;
displaying the target aggregation point on the aggregation location.
Optionally, the obtaining module 201 is specifically configured to:
acquiring a plurality of point data in a map;
and constructing a grid pyramid according to the plurality of point data to obtain a plurality of levels of grids, wherein each level of grid comprises at least one grid node.
Optionally, the obtaining module 201 is specifically configured to:
calculating the outer bounding boxes of the plurality of point data to obtain a first geographical boundary rectangle of the plurality of point data;
uniformly dividing the first geographical boundary rectangle to obtain a plurality of grid nodes in a first-level grid;
and recursively dividing each grid node in the first-level grid one by one to obtain the multi-level grid.
Optionally, the obtaining module 201 is specifically configured to:
and recursively dividing each grid node in the first-level grid one by one according to the number of preset grid point data and a preset grid area until the number of the divided point data in each grid node is smaller than the number of the preset grid point data or the grid area of each divided grid node is smaller than the preset grid area, so as to obtain the multi-level grid.
Fig. 5 is a block diagram of an electronic device 300 according to an embodiment of the present disclosure, and as shown in fig. 5, the electronic device may include: a processor 301, a memory 302.
Optionally, a bus 303 may be further included, wherein the memory 302 is configured to store machine-readable instructions executable by the processor 301 (for example, execution instructions corresponding to the obtaining module, the determining module, and the displaying module in the apparatus in fig. 3, and the like), when the electronic device 300 is operated, the processor 301 and the memory 302 store and communicate through the bus 303, and the machine-readable instructions are executed by the processor 301 to perform the method steps in the foregoing method embodiments.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the method steps in the map data processing method embodiments.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process of the system and the apparatus described above may refer to the corresponding process in the method embodiment, and is not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall cover the scope of the present application.
Claims (10)
1. A method for processing map data, the method comprising:
acquiring a current view angle position in a map;
determining the distance between each grid node in a first-level grid of the map and the visual angle position, wherein the map is divided into multiple levels of grids in advance, and each level of grid comprises at least one grid node;
determining whether each grid node is a polymerizable node or not according to the distance between each grid node in the first-level grid and the view angle position;
if yes, displaying a target aggregation point on the position of the polymerizable node on the map, wherein the target aggregation point is an aggregation point corresponding to the polymerizable node;
if not, acquiring each grid sub-node of the grid nodes, displaying a target aggregation point or acquiring a next-stage grid sub-node of the grid sub-nodes according to the distance between the grid sub-nodes and the visual angle position, circularly executing the step until the current grid node is the last-stage grid sub-node, and displaying the position information corresponding to the current grid node.
2. The map data processing method of claim 1, wherein determining whether each grid node in the first-level grid is a polymerizable node according to a distance between the grid node and the view angle position comprises:
determining whether the distance between the center of the grid node and the visual angle position is greater than the boundary distance corresponding to the grid node;
if so, determining that the grid node is a polymerizable node, otherwise, determining that the grid node is not a polymerizable node.
3. The map data processing method according to claim 2, wherein determining whether the mesh node is a polymerizable node according to a distance between each mesh node in the first-level mesh and the view angle position further comprises:
determining the visual angle gradient corresponding to the grid node according to the visual angle position and the central position of the grid node;
and determining the boundary distance corresponding to the grid nodes according to the point data density coefficient corresponding to the grid nodes, the areas of the grid nodes and the visual angle gradient corresponding to the grid nodes.
4. The map data processing method according to claim 1, wherein displaying a target aggregation point on the map at a position where the polymerizable node is located includes:
determining an aggregate location of the polymerizable node on the map, the aggregate location comprising: the center position of the polymerizable node on the map or the position of a weighted average point of the polymerizable node on the map;
displaying the target aggregation point on the aggregation location.
5. The map data processing method according to any one of claims 1 to 4, wherein before the obtaining of the current view angle position in the map, further comprising:
acquiring a plurality of point data in a map;
and constructing a grid pyramid according to the plurality of point data to obtain a plurality of levels of grids, wherein each level of grid comprises at least one grid node.
6. The map data processing method of claim 5, wherein the constructing a grid pyramid from the plurality of point data to obtain a multi-level grid comprises:
calculating the outer bounding boxes of the plurality of point data to obtain a first geographical boundary rectangle of the plurality of point data;
uniformly dividing the first geographical boundary rectangle to obtain a plurality of grid nodes in a first-level grid;
and recursively dividing each grid node in the first-level grid one by one to obtain the multi-level grid.
7. The map data processing method of claim 6, wherein the recursively dividing mesh nodes in the first-level mesh one by one to obtain the multi-level mesh comprises:
and recursively dividing each grid node in the first-level grid one by one according to the number of preset grid point data and a preset grid area until the number of the divided point data in each grid node is smaller than the number of the preset grid point data or the grid area of each divided grid node is smaller than the preset grid area, so as to obtain the multi-level grid.
8. A map data processing apparatus, characterized by comprising:
the acquisition module is used for acquiring the current view angle position in the map;
the determining module is used for determining the distance between each grid node in a first-level grid of the map and the visual angle position, wherein the map is divided into multiple levels of grids in advance, and each level of grid comprises at least one grid node;
the determining module is used for determining whether each grid node is a polymerizable node according to the distance between each grid node in the first-level grid and the visual angle position;
if yes, a display module is used for displaying a target aggregation point on the position of the polymerizable node on the map, wherein the target aggregation point is an aggregation point corresponding to the polymerizable node;
if not, the obtaining module is used for obtaining each grid sub-node of the grid nodes, displaying a target aggregation point or obtaining a next-stage grid sub-node of the grid sub-node according to the distance between the grid sub-node and the visual angle position, executing the step in a circulating mode until the current grid node is the last-stage grid sub-node, and displaying the position information corresponding to the current grid node.
9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor implements the steps of the map data processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon which, when being executed by a processor, carries out the steps of a map data processing method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211010971.5A CN115374229A (en) | 2022-08-23 | 2022-08-23 | Map data processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211010971.5A CN115374229A (en) | 2022-08-23 | 2022-08-23 | Map data processing method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115374229A true CN115374229A (en) | 2022-11-22 |
Family
ID=84066935
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211010971.5A Pending CN115374229A (en) | 2022-08-23 | 2022-08-23 | Map data processing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115374229A (en) |
-
2022
- 2022-08-23 CN CN202211010971.5A patent/CN115374229A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107481311B (en) | Three-dimensional city model rendering method and device | |
US7561156B2 (en) | Adaptive quadtree-based scalable surface rendering | |
CN111862292B (en) | Data rendering method and device for transmission line corridor and computer equipment | |
CN114119917A (en) | Visual hidden danger ranging method based on high-precision three-dimensional model of power transmission line | |
CN111784840B (en) | LOD (line-of-sight) level three-dimensional data singulation method and system based on vector data automatic segmentation | |
CN112651889A (en) | Fusion filtering method suitable for SLAM point cloud denoising, electronic device and storage medium | |
CN110378992A (en) | Towards large scene model web terminal dynamic rendering LOD processing method | |
CN114519712A (en) | Point cloud data processing method and device, terminal equipment and storage medium | |
CN117786189A (en) | Visual interactive system of three-dimensional map | |
CN105138711A (en) | Primitive indexing method, primitive detecting method, primitive indexing device and a primitive detecting device | |
CN102800125B (en) | Large-scale point cloud selection method for supporting lasso | |
CN118015197B (en) | Live-action three-dimensional logic singulation method and device and electronic equipment | |
CN109003316A (en) | Parallel rasterizing data partition method based on polygon complexity | |
CN116246069B (en) | Method and device for self-adaptive terrain point cloud filtering, intelligent terminal and storage medium | |
CN115374229A (en) | Map data processing method and device, electronic equipment and storage medium | |
CN112184900B (en) | Method, device and storage medium for determining elevation data | |
CN117152341A (en) | Three-dimensional surface extraction method, apparatus and storage medium | |
CN117009411A (en) | Method, device and computer readable storage medium for meshing space storage and indexing based on point cloud data | |
CN116188565A (en) | Position area detection method, device, apparatus, storage medium and program product | |
CN115908318A (en) | Power line sag determination method, device, equipment, medium and product | |
CN112686992A (en) | Geometric figure view frustum realization method and device for OCC tree in smart city and storage medium | |
CN115205434B (en) | Point cloud data visualization processing method and device | |
CN113191310A (en) | Boundary identification method, device and equipment for vector PDF drawing entity filling | |
CN114511571A (en) | Point cloud data semantic segmentation method and system and related components | |
CN112802175A (en) | Large-scale scene occlusion rejection method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |