Map data aggregation display method and system, electronic equipment and storage medium
By dynamically adjusting the aggregation radius and clustering algorithm of map data, the problem of uneven aggregation of map data is solved, and refined display and user-friendly experience are achieved under different scaling levels.
Patent Information
- Application Number
- CN202510499607.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-04-18
AI Technical Summary
The aggregation method of map data in the prior art cannot accurately reflect the real data distribution, especially in uneven aggregation in high-density and low-density areas, resulting in information overload and visual confusion, and it is impossible to effectively aggregate the geographical location information of multiple photos.
By obtaining the scaling hierarchy request and area point density, the aggregation radius is dynamically adjusted using exponential operations and logarithmic operations, the clustering is combined with DBSCAN and K-means algorithms, the aggregation radius is adjusted according to user operations, the center of mass position and weight factor are optimized, and the refined aggregation of map data is achieved.
Dynamic adjustment of map data at different zoom levels is realized, user experience is improved, the aggregation effect is in line with actual conditions, computing resource consumption is reduced, and the visualization efficiency and accuracy of map data is improved.
Smart Images

Figure CN120492553A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of map data processing, and in particular to a method, system, electronic device and storage medium for displaying aggregated map data. Background Art
[0002] Map data often contains a large amount of geographic location information. Displaying all data points directly on the map can lead to information overload and visual clutter. Through data aggregation, a large number of data points can be merged into fewer clusters, thereby reducing the amount of data and improving visualization efficiency.
[0003] The fixed grid aggregation algorithm is a common data aggregation method that divides the map display area into fixed-size rectangular grid cells. All points within each grid cell are forcibly merged into a single cluster point. Due to the use of a preset grid, high-density areas may be over-aggregated, while low-density areas may be under-aggregated, which may not accurately reflect the actual data distribution.
[0004] When there are multiple photos with exactly the same geographic location, we can only simply overlay a numerical label on the corresponding coordinate point to indicate the number of photos, and cannot aggregate them. Summary of the Invention
[0005] The embodiments of the present invention provide a method, system, electronic device and storage medium for displaying aggregated map data to solve the problems in the prior art of being unable to accurately reflect the real data distribution and unable to aggregate photos.
[0006] The present invention discloses a method for displaying aggregated map data, which is applied to an electronic device installed with a target application, and the electronic device is communicatively connected to a network attached storage device. The electronic device can access target data in the network attached storage device through the target application, and the target data includes a target photo and geographic information corresponding to the target photo, including:
[0007] Obtaining a zoom level request for the target data, the zoom level request including a current zoom level and obtaining a regional point density corresponding to the target data based on the geographic information;
[0008] Obtaining a zoom adjustment factor through exponential operation based on the current zoom level, the maximum zoom level, and the minimum zoom level, obtaining a density adjustment factor through logarithmic operation based on the regional point density, and multiplying a preset base radius by the zoom adjustment factor and the density adjustment factor to obtain a target aggregation radius;
[0009] The target photos are displayed based on the target aggregation radius.
[0010] Optionally, the step of multiplying a preset basic radius by the scaling adjustment factor and the density adjustment factor to obtain a target aggregation radius includes:
[0011] The target aggregation radius is obtained according to the following formula:
[0012]
[0013] Wherein, R is the target aggregation radius, R base is the base radius, zoom current is the current zoom level, zoom min Minimum zoom level, zoom max is the maximum zoom level, and density is the point density of the area.
[0014] Optionally, the step of multiplying a preset base radius by the scaling adjustment factor and the density adjustment factor to obtain a target aggregation radius includes:
[0015] Obtaining the amount of target data to be aggregated, and determining whether the amount of target data to be aggregated exceeds a preset threshold;
[0016] If yes, executing the step of obtaining the target aggregation radius based on the zoom level and the regional point density;
[0017] If not, the base radius is used as the target aggregation radius.
[0018] Optionally, the step of displaying the target photo based on the target aggregation radius includes:
[0019] Performing initial clustering on the target data based on the target aggregation radius to obtain initial clustering points;
[0020] A weight factor of each data point is obtained according to the initial clustering point, and an iterative operation is performed based on the weight factor to obtain the target centroid.
[0021] Optionally, the step of obtaining a weight factor for each data point includes:
[0022] Any one of the data points is used as the current data point, the distance between the current data point and the current centroid is obtained, and the weight factor of the current data point is obtained according to the distance.
[0023] Optionally, the step of performing iterative calculation on the weight factor to obtain the target centroid includes:
[0024] Get the iterative centroid of the current centroid according to the following formula;
[0025]
[0026] Among them, x c is the iterative centroid, x i is the current coordinate of the i-th data point, d i is the distance between the i-th data point and the current centroid, w i is the weight factor of the i-th data point.
[0027] Optionally, the step of obtaining a weight factor of the current data point according to the distance includes:
[0028] The attribute weight of the current data point is obtained according to the attribute of the current data point, the distribution weight of the current data point is obtained according to the distance, and the weight factor is obtained according to the attribute weight and the distribution weight.
[0029] Optionally, before the step of displaying the target photo based on the target aggregation radius, the method further includes:
[0030] Acquire user operation information on the target map data, and acquire an operation area and a non-operation area in the target map data;
[0031] Acquire an aggregation area based on the target aggregation radius;
[0032] When the aggregation area is located in the operation area, reducing the target aggregation radius;
[0033] When the aggregation area is located in the non-operation area, the target aggregation radius is increased.
[0034] Optionally, the step of reducing the target aggregation radius includes:
[0035] The reduction ratio is obtained according to the following formula:
[0036] B1=max(0.3,1-(UIF×TDF))
[0037] The step of increasing the target aggregation radius comprises:
[0038] The magnification ratio is obtained according to the following formula:
[0039] B2=1+(2×(1-TDF)×(1-UIF))
[0040] Wherein, B1 is the reduction ratio, B2 is the magnification ratio, UIF is the user operation frequency, and TDF is the time decay from the last operation.
[0041] Optionally, the step of displaying the target photo based on the target aggregation radius includes:
[0042] Acquire multiple aggregation points based on the target aggregation radius and the geographic information, each aggregation point corresponding to at least one target photo;
[0043] Counting the number of aggregations of the target photos corresponding to each aggregation point, obtaining a target display image according to the at least one target photo, and displaying the target display image and the number of aggregations.
[0044] Optionally, the step of acquiring a target display image according to the at least one target photo includes:
[0045] Select multiple target photos to display together; or
[0046] Select one of the target photos to display.
[0047] Optionally, the step of obtaining a zoom level request for target data includes:
[0048] The user's sliding information on the screen of the electronic device is obtained in real time, and the zoom level request is obtained based on the sliding information.
[0049] The present invention also discloses a map data aggregation display system, comprising:
[0050] an acquisition module, configured to acquire a zoom level request for the target data, the zoom level request including a current zoom level, and acquiring a regional point density corresponding to the target data based on the geographic information;
[0051] an aggregation module, configured to obtain a zoom adjustment factor through exponential operation based on the current zoom level, the maximum zoom level, and the minimum zoom level, obtain a density adjustment factor through logarithmic operation based on the regional point density, and multiply a preset base radius by the zoom adjustment factor and the density adjustment factor to obtain a target aggregation radius;
[0052] A display module is configured to display the target photo based on the target aggregation radius.
[0053] The present invention also discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps described above.
[0054] The present invention also discloses a map data aggregation display system, comprising: a network attached storage device and the electronic device described above, wherein the electronic device is installed with an application capable of executing the steps of the method described above;
[0055] or,
[0056] The system includes a network attached storage device and the map data aggregation device described above, and the map data aggregation device is used to perform the steps of the method described above.
[0057] The present invention also discloses a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to execute the steps described above.
[0058] Compared to existing technologies, the map data aggregation display method provided by the embodiments of the present invention has the following advantages: it obtains regional point density based on target map data and zoom level requests; and it obtains a target aggregation radius based on the zoom level and regional point density. The target aggregation radius has an exponential relationship with the zoom level and a logarithmic relationship with the regional point density, which can make the aggregation effect more refined and more in line with actual conditions. At different zoom levels, the aggregation radius is dynamically adjusted, allowing users to more clearly see the distribution of map data at different levels, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments, in which:
[0060] Figure 1 This is a flow chart of an embodiment of the method for aggregated display of map data provided by the present invention;
[0061] Figure 2 It is a schematic diagram of an application scenario of the method for aggregated display of map data provided by the present invention;
[0062] Figure 3 This is a schematic diagram of the aggregation effect of map data in one embodiment provided by this application;
[0063] Figure 4 A schematic diagram of the aggregation effect of map data in another embodiment provided by this application;
[0064] Figure 5 This is a structural diagram of an embodiment of a map data aggregation display system provided by the present invention;
[0065] Figure 6 This is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present invention;
[0066] Figure 7 It is a structural diagram of another embodiment of the map data aggregation display system provided by the present invention. DETAILED DESCRIPTION
[0067] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. Now, in conjunction with the accompanying drawings, the preferred embodiments of the present invention will be described in detail.
[0068] Please refer to Figure 1 and Figure 2 , Figure 1 It is a flowchart of an embodiment of the method for aggregated display of map data provided by the present invention. Figure 2 This is a schematic diagram illustrating an application scenario for the method for aggregated display of map data provided by the present invention. An electronic device 1 is communicatively connected to a network-attached storage device 2. A target application is installed on the electronic device 1, and target data is stored on the network-attached storage device 2. The electronic device 1 can access the target data in the network-attached storage device 2 through the target application, thereby displaying the target data in an aggregated manner. The target data may include a target photo and geographic information corresponding to the target photo, or other data related to geolocation.
[0069] The method for displaying map data in an aggregated manner provided by the present invention specifically includes the following steps:
[0070] S101: Obtain a zoom level request for target data, and obtain regional point density of target map data based on the target data.
[0071] In a specific implementation scenario, target data and map data corresponding to the target data are obtained. The map data includes a map coordinate system and basic map information. The target data includes target data content and corresponding geographic information. The target data content is data content that needs to be aggregated and displayed, such as population data, traffic data, etc., which is a target picture in this embodiment. The target data is coordinate-converted and spatial indexed. The target data content is coordinate-converted based on the map coordinate system, and the target data content is imported into the R language. The corresponding library or extension package (such as spatialindex) in the R language is used to construct an R-tree spatial index. R-tree is a multidimensional index structure suitable for fast query of spatial data. Using the constructed R-tree spatial index, spatial query operations such as range queries and nearest neighbor queries can be accelerated. The R-tree data structure can effectively reduce the amount of data that needs to be searched and improve query efficiency.
[0072] Track the user's zooming operation on the target data to obtain a zoom level request, which includes a specific zoom level. Based on the accessed target data, calculate the distribution of corresponding data points and obtain the regional point density based on the data point distribution.
[0073] S102: Obtain a zoom adjustment factor through exponential operation based on the current zoom level and the maximum zoom level and the minimum zoom level, obtain a density adjustment factor through logarithmic operation based on the regional point density, and multiply the preset basic radius by the zoom adjustment factor and the density adjustment factor to obtain a target aggregation radius.
[0074] In a specific implementation scenario, the change of data during actual aggregation may not be linear, so a nonlinear change strategy is adopted based on the preset basic radius and combined with the current zoom level and regional point density to obtain the target zoom radius. The adoption of a nonlinear change strategy can better capture the complex relationships and characteristics between data, and the nonlinear change strategy can be flexibly adjusted according to different input conditions, so that the system can better adapt to changes in different situations, thereby improving the adaptability and flexibility of the system. For example, the nonlinear change strategy can be a nonlinear function with zoom level and regional point density as parameters. The nonlinear function can include exponential functions, logarithmic functions, etc. In addition, it is also necessary to ensure that the calculated target aggregation radius is within a reasonable range and consider boundary conditions, such as limiting it through minimum aggregation radius and maximum aggregation radius.
[0075] In one embodiment, a zoom adjustment factor is obtained based on the current zoom level, the maximum zoom level, and the minimum zoom level, and a density adjustment factor is obtained based on the area point density. The preset basic radius is multiplied by the zoom adjustment factor and the density adjustment factor to obtain the target aggregation radius. Therefore, the size of the target aggregation radius will be positively affected by the zoom adjustment factor and the density adjustment factor.
[0076] Specifically, the zoom adjustment factor is obtained through exponential operation based on the current zoom level and the maximum zoom level and the minimum zoom level. At low zoom levels (zooming out the view), the zoom adjustment factor grows slowly, which can maintain strong aggregation and avoid excessive scatter points. At high zoom levels (zooming in the view), the zoom adjustment factor will accelerate the expansion, thereby quickly deaggregating to show details.
[0077] The density adjustment factor is obtained through logarithmic operation based on the regional point density. When the regional point density is high, the density adjustment factor increases significantly to avoid excessive overlap. When the regional point density is extremely high, the growth rate of the density adjustment factor will be suppressed by the logarithmic function to prevent the target aggregation radius from getting out of control.
[0078] In one embodiment, the target aggregation radius is obtained according to the following formula:
[0079]
[0080] Among them, R is the target aggregation radius, R base is the base radius, zoom current is the current zoom level, zoommin Minimum zoom level, zoom max is the maximum zoom level, and density is the regional point density.
[0081] R base is the base value that determines the initial scale of the aggregation. It can be the radius at the maximum zoom level or the radius at the minimum zoom level. In this embodiment, R base is the default aggregation radius, which is 10km. base The value can be based on
[0082] is the zoom adjustment factor. When the current zoom level is close to the minimum zoom level, this zoom adjustment factor is close to 1 (1 + 0 = 1). As the zoom level increases, this zoom adjustment factor increases. The square operation in this zoom adjustment factor makes the change in the target aggregation radius more significant when the zoom level changes. Specifically, when the zoom level increases, the target aggregation radius increases faster, quickly reducing the aggregation intensity to show more details. When the zoom level decreases, the target aggregation radius decreases slowly, maintaining a high degree of aggregation to avoid scatter explosion.
[0083] log 10 (density) is the density adjustment factor. Because linear processing of high-density areas results in an excessively large radius, while logarithms can compress extreme values, the density adjustment factor is calculated logarithmically. The greater the regional point density, the larger the logarithmic value, thereby increasing the target aggregation radius. This allows the target aggregation radius for each marker to be adjusted based on the density of the different regions, resulting in a larger target aggregation radius for markers in areas with higher regional point density. This maintains good visualization, ensures the markers' shapes are clear after aggregation, and avoids information loss or visual confusion caused by over-aggregation.
[0084] In summary, the square relationship in the formula makes the radius change more dramatically at detail levels (high zoom), which meets the user's psychological model of expecting rapid disaggregation when zooming in. The logarithmic function prevents the radius from growing uncontrollably in a few hot spots. This can prevent the radius from being too small and causing clutter at low zoom levels, and prevent the radius from being too large and losing local features at high zoom levels.
[0085] In other implementation scenarios, the number of target data to be aggregated is first obtained. For example, the target data can be filtered based on the target map data to obtain target data that meets the aggregation requirements, and the number of these target data is counted as the number to be aggregated. For example, if the target map data is map data of Jiangsu Province, the target data can be filtered to select target data with geographic information within Jiangsu Province as the target data to be aggregated.
[0086] Determine whether the number of points to be aggregated exceeds a preset threshold. If so, execute step S102 to obtain a target aggregation radius based on the zoom level and the point density of the area. If not, directly use the base radius as the target aggregation radius. The base radius can be set according to actual user needs, for example, 10 km. The preset threshold can be set according to actual user needs, for example, 1000.
[0087] Preset thresholds can be used to control algorithm performance. By setting a preset threshold, the amount of data processed by the algorithm can be limited, thereby controlling the algorithm's computational complexity and runtime. The threshold can be set based on the computing capabilities of the electronic device to avoid situations where the threshold is too high, overloading the electronic device and causing system crashes.
[0088] S103: Displaying target map data based on the target aggregation radius.
[0089] In a specific implementation scenario, a clustering algorithm (such as DBSCAN (Density-Based Spatial Clustering of Applications with Noise) and K-means) is used to divide the target map data into multiple cluster data groups based on the target aggregation radius, calculate the number of data points and the centroid of each cluster data group, and display the marked points corresponding to each cluster data group on the map based on the centroid and the number of data points.
[0090] Furthermore, the centroid position of the markers is optimized to more reasonably reflect the original distribution characteristics of the data points. The target data is initially clustered using a clustering algorithm such as DBSCAN. The DBSCAN algorithm performs clustering based on two parameters: ε (epsilon, the neighborhood radius) and MinPts (the minimum number of data points). The target aggregation radius is used as the value of ε. MinPts can be set based on the density of the data, for example, allowing a single point to form its own cluster.
[0091] For each pair of initial cluster points, a weight factor is derived for each data point based on the initial cluster points. An iterative calculation is performed to adjust the centroid position based on the weight factor. This iterative optimization distinguishes primary and secondary points, eliminates noise interference, and ensures that the centroid position is both mathematically optimal and visually plausible. This method performs well in areas requiring high-precision spatial representation, such as smart cities, emergency dispatch, and business analytics, ensuring that machine-generated aggregation results are highly consistent with human spatial cognition expectations.
[0092] In one implementation scenario, the size of the weight factor is related to the distance between the data point and the current centroid. The greater the distance, the smaller the weight. Points that are farther away (such as outliers) have extremely low weights and have little impact on the centroid position, causing the centroid to shift toward areas with high data point density, better showing the aggregation and density distribution of data points, thereby providing more intuitive and meaningful data visualization effects.
[0093] Specifically, the iterative centroid of the current centroid can be obtained according to the following formula:
[0094]
[0095] Among them, x c is the iterative centroid, x i is the current coordinate of the i-th data point, d i is the distance between the i-th data point and the current centroid, w i is the weight factor of the i-th data point.
[0096] If the coordinate offset between two consecutive centroids is less than a preset threshold (0.1 pixel) after a preset number of iterations, the last obtained centroid is used as the target centroid. This approach, using inverse squared distance weighting and small step-size iterations, avoids centroid jumps, ensuring smooth visual jitter and avoiding meaningless calculations.
[0097] In one embodiment, Newton's method is used for iteration:
[0098] In the kth iteration, the center of mass position obtained is x c (k) ,The formula for iterative update is:
[0099]
[0100] Among them, α is the learning rate control step size (usually 0.1 to 0.5), which can be dynamically adjusted to balance speed and stability. is the objective function f(x c ) is the gradient of the mass center, and the mass center is updated in the direction of fastest function descent. The iteration termination condition is set to ||x c (k+1) -x c (k) Stop iteration when ||<0.1.
[0101] Newton's method leverages second-order derivative information (if the Hessian matrix is included) to approach the optimal solution faster than first-order methods such as gradient descent. Furthermore, α can be dynamically adjusted through line search to avoid oscillations.
[0102] In other implementation scenarios, data points can be classified based on their attributes, with different weights assigned to data points of different categories. For example, the importance of each data point can be determined based on the target requirements to be displayed, and each data point can be assigned a weight based on its importance. Alternatively, each data point can be assigned a weight based on its category. For example, in a population education statistics scenario, more weight can be assigned to data points corresponding to people with a bachelor's degree or above, while lower weights can be assigned to people with lower education levels. The size of attribute weights can be customized by the user or automatically assigned based on a preset fixed allocation standard.
[0103] The distribution weight of the data point is obtained according to the distance. This step is basically the same as described above and will not be repeated here. The attribute weight and distribution weight are combined to obtain the weight factor representing the comprehensive weight.
[0104] For example, the weight factor can be obtained according to the following formula:
[0105] W i =β×D i +γ×w i
[0106] Among them, W i is the weight factor, D i is the attribute weight, w i is the distance weight, β is the attribute weight coefficient, γ is the distance weight coefficient, and the specific values of β and γ can be customized by the user.
[0107] After obtaining the weight factor, based on Iterate until the preset stopping condition is met, and obtain the centroid obtained in the last iteration as the target centroid. The specific iterative process is basically the same as described above and will not be repeated here.
[0108] By combining attribute weights with distribution weights, the weight factor calculation comprehensively considers the attribute importance and spatial distribution density of data points. This allows for a more comprehensive consideration of the differences between data points when calculating the weighted centroid, leading to a more accurate determination of the centroid's location. The weight factor calculation ensures that the centroid's location better aligns with the overall characteristics of the data points, ensuring that the resulting cluster points better meet the actual data and the user's personalized needs.
[0109] In other implementation scenarios, when displaying target map data, in order to better meet the user's reference needs, improve the user experience, and respond to the user's interactive behavior on the map in real time, the target aggregation radius of different areas is intelligently adjusted, which can ensure global visualization while giving priority to meeting the user's needs for detailed display of the area of interest.
[0110] It is necessary to obtain the user's operation information on the target map data. The operation information may include single-click, double-click, drag, zoom and other operations. The operation information reflects the user's specific operation behavior and the user's focus on the map data. According to the user's operation information, the map area can be divided into an operation area and a non-operation area. The operation area may be an area where the user frequently performs operations (such as multiple clicks, multiple browsing, multiple zooming, etc.), while the non-operation area is an area where the user rarely performs operations. The location of the user's attention can also be obtained through technologies such as eye tracking, and the area seen by the user is used as the operation area, and the area not seen by the user is used as the non-operation area.
[0111] For the target aggregation radius that has been obtained, different operations are performed in different areas. Narrowing the aggregation radius in areas where users frequently operate can retain more details, allowing users to see the data point details in the area more clearly, and improving users' understanding and perception of the data. Expanding the aggregation radius in inactive areas can reduce the number of data points that need to be presented, thereby improving rendering efficiency. This can save computing resources and speed up the loading of map data. By dynamically adjusting the target aggregation radius in different areas, resources can be reasonably allocated according to user behavior and focus, improving the user's interactive experience. Users will feel that the map data is more in line with their needs, the operation is more intuitive and the response is more timely. At the same time, the rendering efficiency is improved in inactive areas, and the intelligent allocation and utilization of resources are realized.
[0112] The above method can be used to build an adaptive map system centered on the user's visual focus. By dynamically adjusting the target aggregation radius, an intelligent balance is achieved between "global overview" and "local details", and between "rendering performance" and "information richness".
[0113] In one embodiment, when the target aggregation radius needs to be reduced, the reduction ratio can be obtained according to the following formula:
[0114] B1=max(0.3,1-(UIF×TDF))
[0115] When you need to expand the target aggregation radius, you can get the expansion ratio according to the following formula:
[0116] B2=1+(2×(1-TDF)×(1-UIF))
[0117] Among them, B1 is the reduction ratio, B2 is the magnification ratio, UIF is the user operation frequency, and TDF is the time decay from the last operation.
[0118] When user interaction is high (UIF→1), at least 30% of the original details (with a lower limit of 0.3) are retained to prevent over-aggregation and operational failure. After extended periods of inactivity (TDF→0), the default aggregation is automatically restored to conserve resources. Furthermore, with low user interaction (UIF→0) and extended periods of inactivity (TDF→0), the maximum increase in detail is 300% (B=3.0). Furthermore, the product term prevents sudden over-aggregation at the edges.
[0119] Dynamically adjust the aggregation radius based on user operation frequency and time decay, making map data presentation more personalized and adaptable to user operation habits. Users will see more details in frequently operated areas, while achieving higher rendering efficiency in less active areas. This also better balances resource allocation and user experience, improving map data display while meeting user personalized needs, optimizing data visualization, and enhancing user interaction experience.
[0120] Furthermore, dynamic statistical information can be overlaid on the cluster points to display information such as the number of data points corresponding to the cluster point and the classification ratio. This information can be dynamically updated based on the actual data of the cluster point (different cluster points at different zoom levels), providing users with a richer data display. This information can be displayed on the cluster point in the form of text, charts, etc.
[0121] When users zoom in on the map or click on a cluster point, a hierarchical expansion animation can be used to achieve a smooth transition between the cluster point and the original data point. This allows users to more intuitively see the process of cluster points expanding into data points, improving the user experience.
[0122] When a user clicks a cluster point, a pop-up window will appear, displaying detailed information about the data points contained in that cluster point. This allows users to load detailed information on demand, ensuring a smooth interface and data accessibility.
[0123] In other implementations, when the current zoom level exceeds a preset threshold (e.g., level 18), previously aggregated markers are restored to individual display. This can be achieved by removing the aggregation or adjusting the marker display method. At very high zoom levels, markers are displayed as individual points so that users can more clearly view the detailed information of each data point.
[0124] When processing large amounts of data, the front-end computing load may be too high, causing page freezes or crashes, impacting the user experience. To address this issue, Web Workers can be used to perform clustering calculations in a background thread, avoiding blocking the main thread and ensuring page responsiveness. The main thread can focus on rendering and user interaction, while computing tasks are performed in the background thread, improving overall performance. Deploying the aggregation calculation logic on the server-side and utilizing its computing resources for processing can support large-scale data processing, avoiding insufficient front-end processing capabilities, and ensuring system stability and performance.
[0125] In one embodiment, please refer to Figure 3 and Figure 4 , Figure 3 and Figure 4 Schematic diagram of the aggregation effect of the map data provided for this application. Figure 4 is Figure 3 The result of increasing the zoom level (aggregation) based on . Figure 3 and Figure 4 In the scenario shown, the target data includes the target photo and the corresponding geographic information. Geographic information can be automatically or manually collected when capturing the image, or it can be assigned to the image manually later. For example, the geographic information can be GPS coordinates in the Exchangeable Image File Format (EXIF).
[0126] After obtaining the target aggregation radius based on the steps above, corresponding data points are generated on the map data based on the geographic information of each target photo, and these data points are aggregated according to the target aggregation radius to obtain multiple aggregation points. Each aggregation point contains all the data points within the target aggregation radius and corresponds to at least one image data.
[0127] Count the target photos associated with each cluster point and calculate the number of target photos corresponding to that cluster point. For each cluster point, obtain a target display image from the selected target photos, which can be a thumbnail or the original image. Select one or more of the most representative or relevant image data as the target display image. Display the target display image and the number of clusters.
[0128] In one embodiment, if the number of target photos corresponding to a cluster point is less than a preset number (e.g., 4), two or more target photos may be selected for combined display, which may be achieved through image stitching, overlay, or other synthesis techniques. If the number of target photos corresponding to a cluster point is greater than or equal to the preset number, a representative or relevant target photo is selected based on the needs and algorithm. The selection may be based on factors such as image quality, timestamp, and tag. For example, the most recently taken photo or the photo with the highest resolution may be selected. Alternatively, an image similarity algorithm may be used to select the photo with the largest / smallest difference.
[0129] In one embodiment, a user can input a zoom level request by sliding a finger on the screen of an electronic device. For example, a target sliding direction can be preset, and sliding a finger along the target sliding direction increases the zoom level, while sliding a finger against the target sliding direction decreases the zoom level. For another example, a user can slide two or more fingers on the screen. When the distance between the corresponding touch points of each finger on the screen increases, the zoom level increases, and when the distance decreases, the zoom level decreases.
[0130] The system obtains real-time information about a user's scrolling on the electronic device screen, obtains a corresponding zoom level request based on the scroll information, obtains the current target aggregation radius based on the zoom level request, aggregates data points on the map based on the current target aggregation radius, and displays the corresponding aggregation results. The aggregation results can be presented through animation effects or gradual transitions to enhance the user experience.
[0131] Based on the results of the aggregation (increasing the zoom level) and dispersion (reducing the zoom level) operations, the position of the aggregation point is re-rendered. Animation or transition effects can be used to make the aggregation and dispersion process smoother and more natural. When dispersion is required, the aggregation point can be dispersed again to show more details. For example, when the aggregation point is dispersed into multiple sub-points (or reverse aggregation) during the dispersion operation, linear interpolation is used to calculate the intermediate coordinates and update the position frame by frame. Displaying the aggregation and dispersion effects allows users to clearly see the aggregation and dispersion changes of data points, and can achieve high-frequency interaction with users.
[0132] In one embodiment, a Web Worker thread is created to perform clustering calculation tasks. The code of the clustering algorithm is placed in the script file of the Web Worker, and a message is sent to the Web Worker through the main thread to trigger the calculation task. In the main thread, the data that needs to be clustered is sent to the Web Worker thread. After the Web Worker thread performs the calculation, it returns the result to the main thread. After receiving the clustering calculation result returned by the Web Worker, the main thread is responsible for rendering scheduling based on the result. For example, operations such as updating the position of data points on the map and displaying aggregation effects. Using WebWorker can avoid executing time-consuming clustering calculations in the main thread, thereby improving the responsiveness of the page. This method of separating calculation tasks and rendering tasks helps to maintain the smoothness of the page. The present invention can also reduce the rendering pressure of the main thread by controlling the number of aggregation points, thereby ensuring the smoothness of rendering under large-scale data.
[0133] The distributed processing architecture employed by this invention distributes large-scale data across multiple servers for parallel processing, deploying complex and time-consuming aggregation calculation logic on the server side, leveraging the server's computing resources to support real-time aggregation of millions of points. Furthermore, the server side can implement pre-processing and caching mechanisms to pre-process data and store calculation results, reducing response latency and improving system performance.
[0134] As can be seen from the above description, in this embodiment, regional point density is obtained based on the target map data and zoom level request; the target aggregation radius is obtained based on the zoom level and regional point density. The target aggregation radius has an exponential relationship with the zoom level and a logarithmic relationship with the regional point density, which can make the aggregation effect more refined and more in line with actual conditions. At different zoom levels, the aggregation radius will be dynamically adjusted, allowing users to more clearly see the distribution of map data at different levels, improving the user experience.
[0135] See also Figure 5 , Figure 5 The structure diagram of an embodiment of the map data aggregation display system provided by the present invention is shown in FIG. The map data aggregation display system 10 is applied to Figure 2 The application scenario shown includes: an acquisition module 11 , an aggregation module 12 and a display module 13 .
[0136] The acquisition module 11 is used to obtain a zoom level request for the target data, the zoom level request includes the current zoom level, and the regional point density corresponding to the target data obtained based on the geographic information; the aggregation module 12 is used to obtain a zoom adjustment factor through exponential operation based on the current zoom level, the maximum zoom level and the minimum zoom level, obtain a density adjustment factor through logarithmic operation based on the regional point density, and multiply a preset basic radius by the zoom adjustment factor and the density adjustment factor to obtain a target aggregation radius; the display module 13 is used to display the target photo based on the target aggregation radius.
[0137] The aggregation module 12 is further configured to obtain a target aggregation radius according to the following formula:
[0138]
[0139] Among them, R is the target aggregation radius, R base is the base radius, zoom current is the current zoom level, zoom min Minimum zoom level, zoom max is the maximum zoom level, and density is the regional point density.
[0140] The aggregation module 12 is also used to obtain the number of target data to be aggregated and determine whether the number to be aggregated exceeds a preset threshold; if so, execute the step of obtaining the target aggregation radius based on the zoom level and the regional point density; if not, use the basic radius as the target aggregation radius.
[0141] The display module 13 is further configured to perform initial clustering on the target data based on the target aggregation radius to obtain initial clustering points; obtain a weight factor for each data point based on the initial clustering points, and perform iterative calculations based on the weight factors to obtain the target centroid.
[0142] The display module 13 is further configured to take any one of the data points as a current data point, obtain a distance between the current data point and the current centroid, and obtain a weight factor of the current data point based on the distance.
[0143] The display module 13 is further configured to obtain the iterative centroid of the current centroid according to the following formula:
[0144]
[0145] Among them, x c is the iterative centroid, x i is the current coordinate of the i-th data point, d i is the distance between the i-th data point and the current centroid, w i is the weight factor of the i-th data point.
[0146] The display module 13 is further configured to obtain an attribute weight of the current data point according to the attribute of the current data point, obtain a distribution weight of the current data point according to the distance, and obtain a weight factor according to the attribute weight and the distribution weight.
[0147] The display module 13 is also used to obtain user operation information on the target map data, obtain the operation area and non-operation area in the target map data; obtain the aggregation area based on the target aggregation radius; when the aggregation area is located in the operation area, reduce the target aggregation radius; when the aggregation area is located in the non-operation area, increase the target aggregation radius.
[0148] The display module 13 is further configured to obtain a reduction ratio according to the following formula:
[0149] B1=max(0.3,1-(UIF×TDF))
[0150] The magnification ratio is obtained according to the following formula:
[0151] B2=1+(2×(1-TDF)×(1-UIF))
[0152] Among them, B1 is the reduction ratio, B2 is the magnification ratio, UIF is the user operation frequency, and TDF is the time decay from the last operation.
[0153] Among them, the display module 13 is also used to obtain multiple aggregation points based on the target aggregation radius and the geographic information, each aggregation point corresponds to at least one target photo; count the aggregation number of target photos corresponding to each aggregation point, obtain the target display image according to the at least one target photo, and display the target display image and the aggregation number.
[0154] The display module 13 is further used to select a plurality of target photos for combined display; or select one target photo for display.
[0155] The acquisition module 11 is further configured to acquire in real time the sliding information of the user on the screen of the electronic device, and acquire a zoom level request based on the sliding information.
[0156] As can be seen from the above description, in this embodiment, regional point density is obtained based on the target map data and zoom level request; the target aggregation radius is obtained based on the zoom level and regional point density. The target aggregation radius has an exponential relationship with the zoom level and a logarithmic relationship with the regional point density, which can make the aggregation effect more refined and more in line with actual conditions. At different zoom levels, the aggregation radius will be dynamically adjusted, allowing users to more clearly see the distribution of map data at different levels, improving the user experience.
[0157] Figure 6FIG1 shows a schematic diagram of the internal structure of an electronic device in an embodiment. The electronic device can be a terminal or a server. Figure 6 As shown, the electronic device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the electronic device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the method for aggregated display of map data. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the method for aggregated display of map data. It will be understood by those skilled in the art that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0158] In one embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor performs the above steps.
[0159] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the above steps.
[0160] Please refer to Figure 7 , Figure 7 It is a structural diagram of another embodiment of the map data aggregation display system provided by the present invention.
[0161] The map data aggregation display system 20 includes the electronic device 21 and the network attached storage device 22 as described above. The electronic device 21 is installed with an application capable of executing the steps of the method described above.
[0162] In other implementation scenarios, the map data aggregation and display system 20 includes the electronic device 21 and the map data aggregation device 10 described above. The map data aggregation device 10 can execute the steps of the method described above.
[0163] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0164] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0165] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Those skilled in the art may modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein; and all these modifications and replacements should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for displaying aggregated map data, applied to an electronic device having a target application installed thereon, wherein the electronic device is communicatively connected to a network-attached storage device, and the electronic device can access target data in the network-attached storage device through the target application, wherein the target data includes a target photo and geographic information corresponding to the target photo, wherein: include: Obtaining a zoom level request for the target data, the zoom level request including a current zoom level and obtaining a regional point density corresponding to the target data based on the geographic information; Obtaining a zoom adjustment factor through exponential operation based on the current zoom level, the maximum zoom level, and the minimum zoom level, obtaining a density adjustment factor through logarithmic operation based on the regional point density, and multiplying a preset base radius by the zoom adjustment factor and the density adjustment factor to obtain a target aggregation radius; The target photos are displayed based on the target aggregation radius.
2. The method for displaying map data according to claim 1, wherein: The step of multiplying the preset basic radius by the scaling adjustment factor and the density adjustment factor to obtain a target aggregation radius includes: The target aggregation radius is obtained according to the following formula: Wherein, R is the target aggregation radius, R base is the base radius, zoom current is the current zoom level, zoom min Minimum zoom level, zoom max is the maximum zoom level, and density is the point density of the area.
3. The method for displaying map data according to claim 2, characterized in that: The step of multiplying a preset base radius by the scaling adjustment factor and the density adjustment factor to obtain a target aggregation radius includes: Obtaining the amount of target data to be aggregated, and determining whether the amount of target data to be aggregated exceeds a preset threshold; If yes, executing the step of obtaining the target aggregation radius based on the zoom level and the regional point density; If not, the base radius is used as the target aggregation radius.
4. The method for displaying map data according to claim 1, wherein: The step of displaying the target photo based on the target aggregation radius includes: Performing initial clustering on the target data based on the target aggregation radius to obtain initial clustering points; A weight factor of each data point is obtained according to the initial clustering point, and an iterative operation is performed based on the weight factor to obtain the target centroid.
5. The method for displaying map data according to claim 4, characterized in that: The step of obtaining the weight factor of each data point includes: Any one of the data points is used as the current data point, the distance between the current data point and the current centroid is obtained, and the weight factor of the current data point is obtained according to the distance.
6. The method for displaying map data according to claim 5, characterized in that: The step of performing iterative calculation on the weight factor to obtain the target centroid includes: Get the iterative centroid of the current centroid according to the following formula; Among them, x c is the iterative centroid, x i is the current coordinate of the i-th data point, d i is the distance between the i-th data point and the current centroid, w i is the weight factor of the i-th data point.
7. The method for displaying map data according to claim 5, characterized in that: The step of obtaining the weight factor of the current data point according to the distance includes: The attribute weight of the current data point is obtained according to the attribute of the current data point, the distribution weight of the current data point is obtained according to the distance, and the weight factor is obtained according to the attribute weight and the distribution weight.
8. The method for displaying map data according to claim 1, wherein: Before the step of displaying the target photo based on the target aggregation radius, the method further includes: Acquire user operation information on the target map data, and acquire an operation area and a non-operation area in the target map data; Acquire an aggregation area based on the target aggregation radius; When the aggregation area is located in the operation area, reducing the target aggregation radius; When the aggregation area is located in the non-operation area, the target aggregation radius is increased.
9. The method for displaying map data according to claim 8, characterized in that: The step of reducing the target aggregation radius comprises: The reduction ratio is obtained according to the following formula: B1=max(0.3,1-(UIF×TDF)) The step of increasing the target aggregation radius comprises: The magnification ratio is obtained according to the following formula: B2=1+(2×(1-TDF)×(1-UIF)) Wherein, B1 is the reduction ratio, B2 is the magnification ratio, UIF is the user operation frequency, and TDF is the time decay from the last operation.
10. The method for displaying map data according to claim 1, wherein: The step of displaying the target photo based on the target aggregation radius includes: Acquire multiple aggregation points based on the target aggregation radius and the geographic information, each aggregation point corresponding to at least one target photo; Counting the number of aggregations of the target photos corresponding to each aggregation point, obtaining a target display image according to the at least one target photo, and displaying the target display image and the number of aggregations.
11. The method for displaying map data according to claim 10, characterized in that: The step of acquiring a target display image according to the at least one target photo comprises: Select multiple target photos to display together; or Select one of the target photos to display.
12. The method for displaying map data according to claim 1, wherein: The step of obtaining a zoom level request for target data includes: The user's sliding information on the screen of the electronic device is obtained in real time, and the zoom level request is obtained based on the sliding information.
13. A map data aggregation device, characterized in that: The device comprises: an acquisition module, configured to acquire a zoom level request for the target data, the zoom level request including a current zoom level, and acquiring a regional point density corresponding to the target data based on the geographic information; an aggregation module, configured to obtain a zoom adjustment factor through exponential operation based on the current zoom level, the maximum zoom level, and the minimum zoom level, obtain a density adjustment factor through logarithmic operation based on the regional point density, and multiply a preset base radius by the zoom adjustment factor and the density adjustment factor to obtain a target aggregation radius; A display module is configured to display the target photo based on the target aggregation radius.
14. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 12.
15. A map data aggregation display system, characterized in that: include: A network attached storage device and an electronic device according to claim 14, wherein the electronic device has an application installed therein capable of performing the steps of the method according to any one of claims 1 to 12; or, The system comprises a network attached storage device and the map data aggregation device according to claim 13 , wherein the map data aggregation device is configured to execute the steps of the method according to any one of claims 1 to 12 . 16 . A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to claim 1 .
Citation Information
Patent Citations
Communication service package determination method and device, storage medium and electronic device
CN117093886A
Map display method and device, electronic equipment and readable storage medium
CN117909008A
Method and system of interacting with content disposed on substrates
WO2013138846A1
Cited By
Livestock outlier detection method, electronic equipment and computer storage medium
CN121147812A