A web map oriented overlay aggregation method
By building a prediction algorithm and a preloading caching mechanism in the Web map, the number of aggregation layers is predicted and the overlay data is filtered, which solves the problems of slow loading speed and browser smoothness in Web map big data aggregation scenarios, and achieves fast rendering and efficient data processing.
Patent Information
- Application Number
- CN202310309487.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-03-27
AI Technical Summary
In web maps, when large amounts of data are aggregated, existing technologies result in slow page loading speeds and reduced browser smoothness. Furthermore, existing optimization methods suffer from high computational complexity and errors in calculation results.
A preloading caching mechanism is constructed using a prediction algorithm. By establishing a mapping relationship between the scaling layer and the aggregation layer, the number of aggregation layers is predicted using the exponential smoothing method. Overlay data within the visible area is filtered, and data rendering is performed using the cache, thereby reducing the number of aggregation calculations.
It effectively reduces loading time in scenarios involving large-scale aggregation of web maps, improves browser smoothness, and enhances data validity and rendering efficiency.
Smart Images

Figure CN116304436B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of electronic maps, relates to the technical field of geographic information aggregation and visualization, and particularly relates to a cover aggregation method for a Web map. BACKGROUND
[0002] The aggregation technology of Web maps is one of important technologies in map visualization, and can effectively solve the problems of overlapping coverage and information-intensive of map covers. However, with the increase of the number of covers, the huge aggregation calculation amount will cause slow page loading speed and reduced browser fluency.
[0003] Based on this feature, on the one hand, the point aggregation algorithm is usually optimized to improve the aggregation speed at the cost of accuracy; on the other hand, the multi-detail level method is used to perform rendering operation according to the location and importance of the cover, so as to speed up the rendering speed. The above method will increase the calculation complexity and consume CPU performance while accelerating the aggregation; compared with the real aggregation result, the calculation result of the above method has errors and cannot accurately reflect the cover information. SUMMARY
[0004] Therefore, the purpose of the application is to provide a cover aggregation method for a Web map, so as to solve the cover aggregation problem in the large data aggregation scenario, construct a preloading cache mechanism by using a prediction algorithm, and reduce the aggregation calculation times. The page loading time is reduced, and the browser fluency is improved.
[0005] To achieve the above purpose, the application provides the following technical scheme.
[0006] A cover aggregation method for a Web map, specifically comprising the following steps:
[0007] S1: a mapping relationship between a zoom layer and an aggregation layer is established, and the number of aggregation levels is divided;
[0008] S2: an aggregation layer prediction model is constructed by using the idea based on the exponential smoothing method, the number of aggregation layers in the forward and reverse directions of the Web map zoom is predicted by using the prediction model, the Web map visible area is calculated according to the aggregation layer number prediction value, the cover data in the visible area is screened out according to the Web map visible area, and then point aggregation calculation is performed according to the cover data;
[0009] S3: the calculation result of step S2 is stored in the cache;
[0010] Each aggregation data corresponds to a map aggregation level number, if the aggregation level number corresponding to the data to be stored in the cache does not exist in the cache, the data is directly added to the cache; if the aggregation level number of the data to be stored already exists, the new data is directly cached by covering the old data;
[0011] S4: When the map is zoomed, check if there is aggregated data in the cache that matches the current aggregation level. If the query result is not empty, use the queried data to render the data directly. Otherwise, re-execute the point aggregation calculation and then render the data.
[0012] Furthermore, step S1 specifically includes the following steps:
[0013] S11: This invention merges scaling layers with similar aggregation effects into a single aggregation layer.
[0014] S12: Following the rule that the larger the scaling level, the larger the aggregation level, the higher the aggregation level, each aggregation layer is assigned a specific aggregation level. Aggregation effects with the same aggregation level are consistent.
[0015] Furthermore, in step S2, an aggregation layer prediction model is constructed based on the idea of exponential smoothing, specifically including: Let α be the smoothing parameter and 0≤α≤1, T be the current time, and y T-K The number of aggregation layers at time TK; the predicted number of aggregation layers at the next time step. The actual value of the number of aggregate layers, y. T y T-1 ... y T-K+1 The weighted sum, its The calculation formula is as follows:
[0016]
[0017] Transforming the above equation, we get:
[0018]
[0019] The value of K is determined by the cache space allocated by the web browser;
[0020] Let the zoom-in direction of the web map be the positive direction p, and the zoom-out direction be the negative direction n. Calculate the smoothing parameter α based on the number of zoom cycles in each direction. The formula is:
[0021]
[0022] Among them, M p M n These represent the number of scaling operations in the forward and reverse directions, respectively.
[0023] Combining the smoothing parameter α, the prediction model for the aggregation layer is obtained as follows:
[0024]
[0025] Further, in step S2, the visible area of the Web map is calculated according to the predicted value of the number of aggregation layers, and specifically includes: establishing a coordinate system with the upper left corner of the screen as the coordinate origin, each map is placed in a Web page container div, and the default Web map fills the container div, and the vertex coordinates of the div can be obtained through the width and height of the div; the vertex coordinates of the div are converted into latitude and longitude coordinates, and finally the Web map visible area is calculated in combination with the center point of the map and the number of aggregation levels.
[0026] Further, in step S2, the overlay data is screened, and specifically includes: traversing the overlay data, judging the positional relationship between the visible area and the overlay, and screening the overlay data in the visible area.
[0027] Further, in step S2, the point aggregation calculation is performed according to the overlay data, and specifically includes: first, taking each overlay point as the center of the grid, and drawing a square grid outside; judging the geometric relationship of the peripheral grid of each point, if the peripheral grid of the iteration point intersects with the peripheral grid of the aggregated point, the iteration point is attributed to the aggregated point; if the peripheral grid of the iteration point intersects with the peripheral grids of multiple aggregated points, the straight line distance from the iteration point to each aggregated point is compared, and the aggregated point with the shortest distance is selected as the final aggregated point; if it does not intersect, the iteration point does not belong to any existing aggregated point, and no aggregation operation is performed.
[0028] The beneficial effects of the present application are that in the large data aggregation scenario of the Web map, the aggregation layer prediction algorithm is constructed according to the prediction algorithm, and the visible area calculation and the overlay data screening can effectively reduce the aggregation data volume and increase the data effectiveness. Through the Web map aggregation method based on preloading, the cache data is used for aggregation rendering, the aggregation calculation frequency of the overlay during map zooming is reduced, and the purpose of fast aggregation is achieved. The present application reduces the loading time of the Web map in the large data aggregation scenario, and improves the browser fluency.
[0029] Other advantages, objects, and features of the present application will be explained in the following description, and will be apparent to those skilled in the art based on the following description, or can be learned from the practice of the present application. The objects and other advantages of the present application can be achieved and obtained by the following description. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to make the objects, technical solutions and advantages of the present application clearer, the preferred detailed description of the present application will be made below in combination with the drawings, in which:
[0031] Fig. 1 The module schematic diagram of the Web map overlay aggregation method of the present application;
[0032] Fig. 2 A flow chart of the Web map oriented overlay aggregation method of the present application. DETAILED DESCRIPTION
[0033] The advantages and effects of the present application can be easily understood by those skilled in the art from the above description. The present application can also be implemented or applied in other different specific embodiments, and the details in the description can be modified or changed in various ways based on different views and applications without departing from the spirit of the present application. It should be noted that the drawings provided in the following embodiments only schematically illustrate the basic concept of the present application, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0034] Referring to Figs. 1-2 , the present application provides a Web map oriented overlay aggregation method, as shown in Fig. 2 , specifically comprising the following steps:
[0035] S1: establishing a mapping relationship between the zoom layers and the aggregation layers, and dividing the aggregation layer levels; specifically comprising the following steps:
[0036] S11: merging the zoom layers with similar aggregation effects into one aggregation layer.
[0037] S12: setting an aggregation layer level for each aggregation layer according to the rule that the larger the zoom level, the larger the aggregation layer level. The aggregation effects of the aggregation layers with the same aggregation layer level are consistent.
[0038] In step S12, when the map is zoomed, it is first checked whether the current aggregation layer level is consistent with the last aggregation layer level. If not, the cache is queried. If consistent, the last aggregation operation is maintained, and no query operation is performed.
[0039] S2: respectively performing the aggregation layer number prediction, map visible area calculation, overlay data screening and point aggregation calculation in the forward and reverse directions of the Web map zoom.
[0040] In step S2, the operations are strictly performed in the order, and the overlay data screening step can screen the overlay data in the visible area to reduce the data amount for subsequent aggregation calculation.
[0041] S21: constructing an aggregation layer prediction model based on the idea of exponential smoothing. Let α be the smoothing parameter and 0≤α≤1, T be the current time, y T-K T-K be the aggregation layer number at time T-K. The predicted value of the aggregation layer number at the next time is the actual value of the aggregation layer number y T , y T-1 , …, y T-K+1a weighted sum of the The calculation formula is as follows:
[0042]
[0043] The above formula can be transformed as follows:
[0044]
[0045] The value of K is determined by the cache space opened by the Web browser.
[0046] Suppose that the positive direction p of the Web map zooming is the positive direction and the negative direction n is the negative direction, and the smoothing parameter a is calculated according to the number of times of the positive and negative zooming directions of the Web map, and the calculation formula is as follows:
[0047]
[0048] wherein M p , M n respectively represent the number of times of the positive and negative zooming directions.
[0049] In combination with the smoothing parameter a, the aggregation layer prediction model is obtained as follows:
[0050]
[0051] In step S21, when the predicted number of aggregation layers is greater than or equal to the remaining number of aggregation layers, all the remaining aggregation layers are loaded; when the preloaded number of aggregation layers is less than the remaining number of aggregation layers, step S21 is executed for the prediction calculation. If the aggregation layer after the map zooming is the maximum or minimum layer, the direction with the remaining number of aggregation layers of 0 does not need to be predicted and calculated, and the direction with the remaining number of aggregation layers not being 0 sets the predicted number of aggregation layers to the average number of aggregation layers The calculation formula is as follows:
[0052]
[0053] wherein S i represents the number of aggregation layers after the i th jump of the map zooming; n represents the total number of zooming; S r represents the remaining number of aggregation layers.
[0054] S22: The predicted value of the number of aggregation layers in step S21 is used to calculate the visible area. A coordinate system is established with the upper left corner of the screen as the coordinate origin, each map is placed in a Web page container div, and the default Web map covers the container div. The width and height of the div can be used to obtain the vertex coordinates of the div. The vertex coordinates of the div are converted into longitude and latitude coordinates, and finally the Web map visible area is calculated in combination with the center point of the map and the number of aggregation layers.
[0055] S23: The calculated web map visible area in step S22 is used to filter the overlay data. The overlay data is traversed, the position relationship between the visible area and the overlay is determined, and the overlay data in the visible area is filtered out.
[0056] S24: The overlay data filtered in step S23 is subjected to point aggregation calculation. First, a square grid is drawn with each overlay point as the center of the grid; the geometric relationship of the peripheral grid of each point is determined, if the peripheral grid of the iteration point intersects with the peripheral grid of the aggregated point, the iteration point is attributed to the aggregated point; if the peripheral grid of the iteration point intersects with the peripheral grid of multiple aggregated points, the straight-line distance of the iteration point to each aggregated point is compared, and the aggregated point with the shortest distance is selected as the final aggregated point; if there is no intersection, the iteration point is not attributed to any existing aggregated point, and no aggregation operation is performed.
[0057] S3: The calculation result in step S2 is stored in the cache. Each aggregated data corresponds to a map aggregation level number, if the cache does not have the aggregation level number corresponding to the data to be stored, the data is directly added to the cache; if the aggregation level number of the data to be stored already exists, the new data directly covers the old data for caching. Index technology is used when creating the cache to speed up the cache query speed.
[0058] S4: When the map is zoomed in, it is queried whether the cache has aggregated data matching the current aggregation level number. If the query result is not empty, the query data is used for data rendering; otherwise, the point aggregation calculation is re-executed, and data rendering is performed.
[0059] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the technical solutions, which should be covered in the scope of the claims of the present application.
Claims
1. A method for overlay aggregation in web maps, characterized in that, The method specifically includes the following steps: S1: Establish the mapping relationship between the scaling layer and the aggregation layer, and divide the aggregation layer into levels; S2: Construct an aggregation layer prediction model based on the idea of exponential smoothing, and use this prediction model to predict the number of aggregation layers in the forward and reverse directions of web map zooming. Calculate the visible area of the web map based on the predicted number of aggregation layers, then filter out the overlay data within the visible area based on the visible area of the web map, and finally perform point aggregation calculation based on the overlay data. A clustered prediction model is constructed based on the idea of exponential smoothing, specifically including: setting... For smoothing parameters and , T For the current moment, for Number of aggregation layers at time step 1; predicted number of aggregation layers at the next time step. This is the actual value of the number of polymer layers. The weighted sum, its The calculation formula is as follows: Transforming the above equation into: in, K The value of is determined by the cache space allocated by the web browser; Let the zoom-in direction of the web map be the positive direction. p The shrinking direction is the opposite direction. n Calculate smoothing parameters based on the number of times the web map is zoomed in and out in both directions. The formula for its calculation is: in, , These represent the number of scaling operations in the forward and reverse directions, respectively. Combined with smoothing parameters The aggregation layer prediction model is obtained as follows: S3: Store the calculation result of step S2 into the cache; Each aggregated data corresponds to a map aggregation level. If the aggregation level corresponding to the data to be stored is not in the cache, it will be added directly to the cache. If the aggregation level of the data to be stored already exists, the new data will directly overwrite the old data and be cached. S4: When the map is zoomed, check if there is aggregated data in the cache that matches the current aggregation level. If the query result is not empty, use the queried data to render the data directly. Otherwise, re-execute the point aggregation calculation and then render the data.
2. The method for polymerizing the covering material according to claim 1, characterized in that, In step S2, the visible area of the Web map is calculated based on the predicted value of the number of aggregation layers. Specifically, this includes: establishing a coordinate system with the top left corner of the screen as the origin; placing each map in a Web page container div; by default, the Web map fills the container div; obtaining the div vertex coordinates through the width and height of the div; converting the div vertex coordinates into latitude and longitude coordinates; and finally combining the map center point and the number of aggregation layers to calculate the visible area of the Web map.
3. The method for polymerizing the covering material according to claim 1, characterized in that, In step S2, filtering the overlay data specifically includes: traversing the overlay data, determining the positional relationship between the visible area and the overlay, and filtering out the overlay data within the visible area.
4. The method for polymerizing the covering material according to claim 1, characterized in that, In step S2, point aggregation calculation is performed based on the overlay data. Specifically, this includes: first, drawing a square grid around each overlay point as the center of the grid; determining the geometric relationship of the outer grid of each point; if the outer grid of the iteration point intersects with the outer grid of the already aggregated points, the iteration point is assigned to that aggregation point; if the outer grid of this iteration point intersects with the outer grids of multiple already aggregated points, the straight-line distance from this iteration point to each aggregation point is compared, and the closest aggregation point is selected as the final aggregation point; if they do not intersect, this iteration point is not assigned to any existing aggregation point, and no aggregation operation is performed.
Citation Information
Patent Citations
Method for realizing gathering and scattering visualization of mass ground object mark points through layered grid division
CN109977179A
Animation generation method and device, equipment, storage medium and program product
CN113781615A