Map scatter display method, device and equipment, storage medium and program product
Patent Information
- Application Number
- CN202611188885.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本申请实施例提供了一种地图散点显示方法、装置、设备、存储介质及程序产品,能够解决聚类簇无法准确显示散点分布情况的问题
[0023] The beneficial effects of the technical solution provided in this application are as follows: First, the distance threshold is determined based on the scaling ratio, so that the clustering granularity dynamically adapts to the map scaling. Second, the sets are first divided according to administrative regions, and then each set is clustered separately, ensuring that the clusters are strictly limited to their respective administrative boundaries and that there is no cross-regional mixing. The regional distribution characteristics of the scattered points can be clearly and accurately reflected at different scaling levels, effectively improving the information transmission efficiency and user experience of the map.
Smart Images

Figure CN122925475A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, storage medium, and program product for displaying map scatter points. Background Technology
[0002] With the development of internet technology, the number of scattered points marked in map applications is growing rapidly, such as chain stores and delivery stations, often reaching tens or even hundreds of thousands. To avoid screen congestion and performance degradation caused by displaying scattered points one by one, it is usually necessary to cluster the scattered points, merging those that are close together into clusters and displaying the number of scattered points within each cluster.
[0003] In related technologies, a common clustering method is to set a fixed distance threshold. When the distance between two scattered points is less than this threshold, they are grouped into the same cluster, and the location and number of clusters are displayed on the map as circular markers. However, this distance threshold is independent of the map's zoom level. When the map zoom level changes, the clustering results cannot be adjusted reasonably, resulting in an inaccurate representation of the distribution of scattered points. Summary of the Invention
[0004] This application provides a method, apparatus, device, storage medium, and program product for displaying scattered points on a map, which can solve the problem that clustering cannot accurately display the distribution of scattered points. The technical solution is as follows: On the one hand, a method for displaying scatter points on a map is provided, the method comprising: Obtain the current zoom level of the map and the coordinates of scattered points within the current display area of the map, where the current display area includes multiple administrative regions; Based on the scaling ratio, a distance threshold is determined. Based on the coordinates, the scattered points are divided into multiple sets according to their respective administrative regions. Based on the distance threshold, the scattered points in each set are clustered to obtain multiple clusters. The map displays the labeling information of the corresponding clusters in each administrative region. The labeling information of the clusters includes the location of the clusters and the number of scattered points.
[0005] In one possible implementation, determining the distance threshold based on the scaling ratio includes: Get the administrative level of the currently displayed administrative region on the map; The distance threshold is determined based on the scaling ratio and the hierarchical level of the administrative region.
[0006] In another possible implementation, clustering the scatter points within each set based on the distance threshold includes: The radius factor of each scatter point is determined based on the amount of business data corresponding to each scatter point. For any two scattered points in the same set, if the distance between the two scattered points is less than or equal to the sum of the product of the distance threshold and the radius factor of each of the two scattered points, the two scattered points are determined to belong to the same cluster.
[0007] In another possible implementation, the amount of business data is positively correlated with the radius factor, and the upper limit of the radius factor is less than or equal to a specified upper limit value.
[0008] In another possible implementation, the method further includes: In response to panning or zooming operations on the map, the labeling information of the clusters is hidden; In response to the cessation of the translation or scaling operation, the scattered points within each set are clustered again within a specified time period.
[0009] In another possible implementation, the further clustering of scatter points within each set includes: Configure task numbers for the operation of clustering the scattered points within each set; In response to the completion of clustering, the clustering result is obtained, and it is determined whether the task number corresponding to the clustering result is consistent with the latest task number. If the task number corresponding to the clustering result is inconsistent with the latest task number, the clustering result is discarded.
[0010] In another possible implementation, the method further includes: In response to the total number of scatter points to be clustered being greater than or equal to a specified number, the clustering task of the scatter points to be clustered is executed in a background thread.
[0011] In another possible implementation, the method further includes: The average position is obtained by averaging the coordinates of all scattered points within the cluster. The average position is used as the position of the cluster.
[0012] On the other hand, a map scatter display device is provided, the device comprising: The acquisition module is configured to acquire the current zoom level of the map and the coordinates of scattered points within the current display area of the map, the current display area including multiple administrative regions; The clustering module is configured to determine a distance threshold based on the scaling ratio, divide the scattered points into multiple sets according to their respective administrative regions based on the coordinates, and cluster the scattered points in each set based on the distance threshold to obtain multiple clusters. The display module is configured to display the labeling information of the corresponding clusters in each administrative region of the map. The labeling information of the clusters includes the location of the clusters and the number of scatter points.
[0013] In one possible implementation, the clustering module is used for: Get the administrative level of the currently displayed administrative region on the map; The distance threshold is determined based on the scaling ratio and the hierarchical level of the administrative region.
[0014] In another possible implementation, the clustering module is used for: The radius factor of each scatter point is determined based on the amount of business data corresponding to each scatter point. For any two scattered points in the same set, if the distance between the two scattered points is less than or equal to the sum of the product of the distance threshold and the radius factor of each of the two scattered points, the two scattered points are determined to belong to the same cluster.
[0015] In another possible implementation, the amount of business data is positively correlated with the radius factor, and the upper limit of the radius factor is less than or equal to a specified upper limit value.
[0016] In another possible implementation, the clustering module is further configured to: In response to panning or zooming operations on the map, the labeling information of the clusters is hidden; In response to the cessation of the translation or scaling operation, the scattered points within each set are clustered again within a specified time period.
[0017] In another possible implementation, the clustering module is further configured to: Configure task numbers for the operation of clustering the scattered points within each set; In response to the completion of clustering, the clustering result is obtained, and it is determined whether the task number corresponding to the clustering result is consistent with the latest task number. If the task number corresponding to the clustering result is inconsistent with the latest task number, the clustering result is discarded.
[0018] In another possible implementation, the clustering module is further configured to: In response to the total number of scatter points to be clustered being greater than or equal to a specified number, the clustering task of the scatter points to be clustered is executed in a background thread.
[0019] In another possible implementation, the display module is used for: The average position is obtained by averaging the coordinates of all scattered points within the cluster. The average position is used as the position of the cluster.
[0020] On the other hand, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the method described in any of the above.
[0021] On the other hand, a non-transitory computer-readable storage medium is provided, the non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in any of the preceding claims.
[0022] On the other hand, a computer program product is provided, including computer program instructions that, when run on a computer, cause the computer to perform the method described in any of the preceding claims.
[0023] The beneficial effects of the technical solution provided in this application are as follows: First, the distance threshold is determined based on the scaling ratio, so that the clustering granularity dynamically adapts to the map scaling. Second, the sets are first divided according to administrative regions, and then each set is clustered separately, ensuring that the clusters are strictly limited to their respective administrative boundaries and that there is no cross-regional mixing. The regional distribution characteristics of the scattered points can be clearly and accurately reflected at different scaling levels, effectively improving the information transmission efficiency and user experience of the map. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application; Figure 2 This is a flowchart of the map scatter display method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the map scatter display device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0027] With the development of internet technology, the number of scattered points marked in map applications is growing exponentially, such as chain stores, delivery stations, and service outlets, often reaching tens or even hundreds of thousands. When users view these massive numbers of scattered points on a map, displaying each point individually would not only lead to a crowded map and points obscuring each other, but also cause a decrease in rendering performance and page lag. Therefore, it is usually necessary to cluster the scattered points on the map, merging nearby points into a cluster and displaying the number of points contained in each cluster on the map to present the distribution of scattered points in a visually intuitive way.
[0028] In related technologies, a common way to cluster map points is to set a fixed distance threshold (such as using fixed grid clustering or DBSCAN density clustering algorithm), compare the distance between any two points on the map with the threshold, and when the distance between two points is less than the threshold, the two points are assigned to the same cluster. Finally, the location and number of points in each cluster are displayed on the map as circular markers.
[0029] However, because a fixed distance threshold is used for clustering, which is independent of the map's zoom level, the clustering results cannot be adjusted reasonably when the map's zoom level changes. Specifically, when the map is zoomed out to display a larger area, users expect to see the distribution of scattered points across different administrative regions. However, the fixed distance threshold merges scattered points that originally belonged to different administrative regions into a single large cluster, resulting in users seeing only a circular marker containing a large number of scattered points, failing to accurately represent the distribution of scattered points. Conversely, when the map is zoomed in to display a smaller area, users expect to see finer details of the scattered point distribution. However, the fixed distance threshold still maintains the scattered points within the currently displayed area at the same aggregation granularity as the zoomed-out view, leading to a fragmented display and redundant number labels, thus the clusters cannot accurately represent the distribution of scattered points.
[0030] This application provides a method for displaying scatter points on a map. This method can be applied to a terminal. For example... Figure 1 As shown, the terminal may include a processor 110, a memory 120, and a communication component 130.
[0031] The processor 110 can be a central processing unit (CPU), graphics processing unit (GPU), microcontroller unit (MCU), accelerated processing unit (APU), neural processing unit (NPU), tensor processing unit (TPU), field-programmable gate array (FPGA), application-specific integrated circuit (ASIC), digital signal processor (DSP), etc.
[0032] The memory 120 may include volatile memory and / or non-volatile memory. Volatile memory may include random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), etc. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, non-volatile random access memory (NVRAM), etc.
[0033] The communication component 130 can be a wireless communication module (WCM), a subscriber identity module (SIM), a universal subscriber identity module (USIM), an optical network unit (ONU), etc. The communication component 130 can be used for communication between the terminal and a server, or other terminals.
[0034] This application provides a method for displaying scatter points on a map, such as... Figure 2 As shown, in some embodiments, the method includes: S201. Obtain the current zoom level of the map and the coordinates of scattered points within the current display area of the map, wherein the current display area includes multiple administrative regions.
[0035] The zoom level refers to the zoom level of the map engine during rendering, representing the size of the geographical area covered by the current map view. A smaller zoom level indicates a larger geographical area displayed (e.g., the entire country); a larger zoom level indicates a smaller geographical area displayed (e.g., a single district or county). The current display region refers to the area of the viewport currently visible to the user on the map interface, also known as the viewport. An administrative region refers to a geographical area with administrative boundaries, such as provincial-level administrative regions (provinces, autonomous regions, municipalities, special administrative regions), municipal-level administrative regions (prefecture-level cities, regions, autonomous prefectures), and district / county-level administrative regions (municipal districts, county-level cities, counties). The coordinates of a scatter point refer to the location information of each scatter point in the map coordinate system, such as longitude and latitude values.
[0036] In practice, the zoom level of the current map can be obtained through the application programming interface (API) provided by the map engine. Taking a commonly used map engine as an example, the zoom level is usually a floating-point number between 0 and 20, where level 0 represents displaying the entire Earth, and each additional level represents doubling the zoom level. Simultaneously, the boundary coordinates of the current display area, such as the latitude and longitude coordinates of the southwest and northeast corners, are obtained, and all scattered points within the current display area are determined based on these boundary coordinates.
[0037] Specifically, a list of scattered data points is maintained, each containing its latitude and longitude coordinates in the map coordinate system and the administrative division code (adcode) of its respective administrative region. When retrieving scattered points within the current display area, all scattered points are first filtered based on the boundary coordinates of the display area, identifying those within the boundary coordinate range as scattered points within the current display area. Furthermore, the depth information of the map stack can be used to filter scattered points: when the map stack depth is 1 (i.e., a national-level view), all scattered points are retained; when the map stack depth is 2 (i.e., a provincial view), filtering is performed according to the standardized name of the province to which the scattered points belong, retaining only those belonging to the currently displayed province; when the map stack depth is 3 (i.e., a city-level view), further filtering is performed based on the standardized name of the city to which the scattered points belong, retaining only those belonging to the currently displayed city. In this way, the processing scope of scattered points can be progressively reduced according to the user's drill-down level, improving the efficiency of subsequent clustering calculations.
[0038] Before obtaining the scatter coordinates, initialization is required. Specifically, the terminal device registers national-level administrative boundary vector data with the map engine, constructs an administrative region code mapping table from the feature attributes and index table in GeoJSON format (geographic data format standard), and writes it to the cache with the original name and normalized name as a double key so that the corresponding administrative code can be quickly found by administrative region name later.
[0039] For example, when a user views the distribution of communities on a smart property management platform in a national view, the terminal device obtains that the current zoom level is 3.5, the current display area is the whole country, and the number of scattered points to be processed is 15,000. Each scattered point corresponds to a community and includes the longitude and latitude coordinates of the community as well as the administrative code information of the province and city to which it belongs.
[0040] By obtaining the current zoom level of the map and the coordinates of scattered points within the display area, a data foundation is provided for subsequent adaptive adjustment of the clustering granularity based on the zoom level. This enables the clustering results to be dynamically adjusted as the map view changes, solving the problem in related technologies where fixed distance thresholds cannot adapt to different zoom levels.
[0041] S202. Determine a distance threshold based on the scaling ratio, divide the scattered points into multiple sets according to their respective administrative regions based on the coordinates, and cluster the scattered points in each set based on the distance threshold to obtain multiple clusters.
[0042] The distance threshold is a reference value used to determine whether two scattered points should be assigned to the same cluster. The value of the distance threshold is dynamically adjusted according to the scaling ratio. A set is a subset of all scattered points divided according to their administrative regions; each set corresponds to one administrative region. A cluster is a group of scattered points obtained by clustering them according to the distance threshold within the same set. Scattered points within the same cluster are geographically close.
[0043] In practice, the distance threshold is negatively correlated with the scaling ratio. That is, the smaller the scaling ratio (the larger the map display area), the larger the distance threshold, the coarser the clustering granularity, and more scattered points will be merged into the same cluster. The larger the scaling ratio (the smaller the map display area), the smaller the distance threshold, the finer the clustering granularity, and the easier it is for the cluster to be split into smaller clusters.
[0044] Regarding the specific implementation of determining the distance threshold based on the zoom ratio, a view distance-hierarchy joint axis threshold algorithm can be used. This algorithm first converts the map engine's zoom ratio into an equivalent view distance D, using the formula: D = BASE × (Z_ref / max(geoZoom, ε)), where BASE is a baseline constant (e.g., 100), Z_ref is a reference zoom level (e.g., 1), geoZoom is the current zoom ratio, and ε is a minimum value to prevent division by zero (e.g., 10 to the power of -6). Next, the zoom scale is calculated using the formula: zoomScale = BASE / max(D, ε). Then, based on the current administrative region's hierarchy L (e.g., 0 for national, 1 for provincial, 2 for municipal, and 3 for district / county), the hierarchy scaling factor scaleFactor is determined using the formula: scaleFactor = zoomScale raised to the power of exponent(L), where exponent(L) is the exponential function corresponding to hierarchy L. When zoomScale is greater than 1 (i.e., the map is in a high-magnification state), the high-magnification tightening factor zoomInTighten is further calculated, with the formula: zoomInTighten = min(cap(L), 1 + log2(zoomScale) × slope(L)), where cap(L) is the upper limit value corresponding to level L, and slope(L) is the slope value corresponding to level L. Finally, the axis threshold T is calculated, with the formula: T = baseThreshold(L) / (scaleFactor × zoomInTighten), where baseThreshold(L) is the base threshold corresponding to level L. For the national level, it is also necessary to ensure that the axis threshold is not lower than the minimum threshold T_min_nation, i.e., T = max(T_min_nation, T). Through the above calculations, the axis threshold T is the distance threshold.
[0045] Regarding the division of scattered points into multiple sets based on their administrative regions, the binning strategy is determined according to the current map display level. In the national view, all scattered points are binned by province, with each province corresponding to one set. In the provincial view, binning is performed using the "province|city" composite key, with each prefecture-level city corresponding to one set. In the city view, binning is performed by district / county, with each district / county corresponding to one set. By binning by administrative region, clustering calculations can be limited to the same administrative region, avoiding the erroneous merging of scattered points across administrative regions. It also decomposes large-scale clustering problems into multiple smaller sub-problems, significantly improving computational efficiency.
[0046] Regarding the specific implementation of clustering scattered points within each set, a clustering algorithm based on variable radius circle overlap determination and breadth-first search (BFS) connected component clustering can be adopted. Specifically, for any two scattered points within the same set, the squared distance (dx² + dy²) in the map coordinate system is calculated and compared with the square of a distance threshold. When the squared distance is less than or equal to the square of the distance threshold, the two scattered points are determined to belong to the same cluster. To address the efficiency issue of clustering large-scale scattered points, a BFS traversal approach can be used to find connected components: starting from an unvisited scattered point, all scattered points whose distance is within the threshold range are found, these scattered points are marked as visited and added to the current cluster, and then the same operation is recursively performed on these newly added scattered points until no more neighboring scattered points can be found.
[0047] For example, with the current zoom level of 3.5 (national view), the calculated distance threshold T is 50 (in pixels). A set of provinces contains 2000 scattered points. After BFS connected component clustering, 15 clusters are obtained, of which the largest cluster contains 800 scattered points and the smallest cluster contains 3 scattered points.
[0048] By dynamically determining the distance threshold based on the scaling ratio and clustering the scattered points into buckets according to administrative regions, the clustering granularity is adaptively adjusted according to the map scaling ratio. At the same time, the computational scale of clustering is reduced by dividing the data into administrative regions. This ensures that the clustering results can accurately reflect the distribution of scattered points in different administrative regions and improves the efficiency of clustering computation.
[0049] S203. Display the labeling information of the corresponding clusters in each administrative region of the map. The labeling information of the clusters includes the location of the clusters and the number of scattered points.
[0050] Marker information refers to visual elements used to display clusters on the map, including but not limited to circular markers, numerical labels, and color codes. The location of a cluster refers to its displayed coordinates on the map, and the number of scatter points refers to the total number of scatter points contained within that cluster.
[0051] In practice, after clustering calculations are completed, for each cluster, the center position of the cluster is calculated based on the coordinates of all scattered points within the cluster, and the number of scattered points within the cluster is counted. Then, the cluster marker information is rendered on the corresponding administrative region of the map. The specific format of the marker information can vary depending on the number of scattered points within the cluster. For example, when the number of scattered points is small (e.g., less than 10), a smaller circular marker is used; when the number of scattered points is large (e.g., more than 100), a larger circular marker is used, and different quantity levels are distinguished by color intensity. The marker information also includes textual annotations of the number of scattered points, allowing users to intuitively understand the concentration of scattered points in each area.
[0052] At the rendering level, the map rendering layers, arranged from lowest to highest (Z-order), include: a decorative map layer, a provincial capital reference scatter plot layer, and a business scatter plot layer. The decorative map layer, at the lowest Z-order level, handles map navigation and interaction functions such as dragging, panning, and zooming. The provincial capital reference scatter plot layer, at the middle Z-order level, displays reference location markers for each province's capital; this layer is silent and does not respond to user clicks. The business scatter plot layer, at the highest Z-order level, displays cluster marker information and responds to user clicks and hover interactions. This layered rendering decouples map navigation from business scatter plot interactions, preventing users from accidentally touching scatter plot markers while dragging the map, and also allows for independent control of the display and hiding of the business scatter plot layer.
[0053] For clusters containing only a single point, the terminal device can directly display the point's marker information at its original coordinates without aggregating the markers. For clusters containing multiple points, a cluster marker is displayed at the center of the cluster, containing a numerical label indicating the total number of points. Users can click the cluster marker to trigger a drill-down operation and view detailed information about the points within the cluster.
[0054] For example, in the national view, there are 5 clusters corresponding to Guangdong Province. The cluster corresponding to Guangzhou contains 500 scattered points, and the cluster corresponding to Shenzhen contains 380 scattered points. The labeling information is displayed on the map in the form of circular markers and numbers.
[0055] By displaying the corresponding cluster information in each administrative region of the map, including the location of the clusters and the number of scattered points, users can intuitively understand the distribution and concentration of scattered points in different administrative regions. Simultaneously, a layered rendering strategy decouples map navigation from scattered point interaction, enhancing the user experience.
[0056] In some embodiments, determining the distance threshold based on the scaling ratio includes: Obtain the hierarchy of the administrative region currently displayed on the map; determine the distance threshold based on the zoom level and the hierarchy of the administrative region.
[0057] The administrative hierarchy level refers to the administrative division level corresponding to the current map viewport. For example, the national level is level 0, the provincial level is level 1, the municipal level is level 2, and the district / county level is level 3. Different levels correspond to different geographic scales and display granularity requirements.
[0058] In practice, when determining the distance threshold, not only the zoom level but also the currently displayed administrative region level are considered in the joint calculation. This is because the actual geographical distance corresponding to the same zoom level may differ at different administrative region levels. For example, in the national view and the provincial view, although the zoom level may be the same, the user's desired clustering granularity differs: in the national view, users expect to view the distribution overview by province level, while in the provincial view, users expect to view the distribution overview by city level. Therefore, different base thresholds (baseThreshold(L)) are set according to different administrative region levels; the higher the level (i.e., the larger the displayed geographical area), the larger the base threshold; the lower the level (i.e., the smaller the displayed geographical area), the smaller the base threshold.
[0059] The current administrative region's level is determined based on the depth information of the map stack. The map stack records the user's drill-down history from the national level down to the provincial, municipal, and county levels, with the top element representing the highest-level administrative region currently displayed. The level information corresponding to the top element is read and mapped to an aggregated level enumeration value (e.g., 0 for national level, 1 for provincial level, 2 for municipal level, and 3 for county level). Then, combining the zoom level and the level enumeration value, a distance threshold is calculated using the aforementioned view distance-level joint axis thresholding algorithm.
[0060] For example, when the zoom level is 5.0, if the current administrative region level is provincial (L=1), the calculated distance threshold T is 30; if the current administrative region level is municipal (L=2), the calculated distance threshold T is 15. By introducing a hierarchy factor, the same zoom level produces different clustering granularities at different levels, which better meets the viewing needs of users at different view levels.
[0061] In this embodiment, the distance threshold is determined by combining the zoom level and the administrative region level. This allows the distance threshold to not only adaptively adjust with the zoom level, but also to be set differently according to different administrative region levels. As a result, it can provide a suitable clustering granularity under different view levels, thereby improving the rationality of the clustering results and the user experience.
[0062] In some embodiments, clustering the scatter points within each set based on the distance threshold includes: The radius factor of each scatter point is determined based on the amount of business data corresponding to each scatter point; for any two scatter points in the same set, when the distance between the two scatter points is less than or equal to the sum of the product of the distance threshold and the respective radius factors of the two scatter points, the two scatter points are determined to belong to the same cluster.
[0063] Among them, business metric refers to the numerical indicators of business dimensions associated with the scatter points, such as the number of photos corresponding to a community, the number of service orders corresponding to a service outlet, and the average daily delivery volume corresponding to a delivery station. Radius factor refers to the effective contribution coefficient of each scatter point in the clustering determination. The larger the radius factor, the easier it is for the scatter point to be merged with other scatter points during clustering.
[0064] In practice, a radius factor is calculated for each scatter point during the clustering process, and the radius factor is combined with a distance threshold for clustering determination. For any two scatter points i and j in the same set, the squared distance between the two scatter points in the map coordinate system is calculated: dist² = (x_i...j ... x_j)²+(y_i y_j)², and simultaneously calculate the product of the sum of the radius factors of each of the two scatter points and the distance threshold: T×(f_i+f_j), where f_i is the radius factor of scatter point i and f_j is the radius factor of scatter point j. When the condition dist²≤[T×(f_i+f_j)]² is satisfied (where T is the distance threshold, f_i is the radius factor of scatter point i, and f_j is the radius factor of scatter point j), it is determined that scatter points i and j belong to the same cluster.
[0065] The radius factor of each scatter point is calculated as follows: f_i = min(f_max, f_base + k × √metric_i), where metric_i is the amount of business data corresponding to scatter point i (e.g., the number of photos, photoCount), f_base is the base radius factor (e.g., 1.0), k is an adjustment coefficient (e.g., 0.5), and f_max is the upper limit of the radius factor (e.g., 1.8). According to this formula, scatter points with larger amounts of business data have larger radius factors, making it easier for them to incorporate surrounding scatter points into their own clusters during clustering. This is reasonable in practical business scenarios: scatter points with large amounts of business data are usually larger or more important nodes (e.g., large residential areas, key service sites), and should have a greater aggregation influence on the map.
[0066] For example, scatter point A corresponds to 100 photos, and scatter point B corresponds to 25 photos. According to the formula above, the radius factor of scatter point A is f_A = min(1.8, 1.0 + 0.5 × √100) = min(1.8, 1.0 + 5.0) = 1.8; the radius factor of scatter point B is f_B = min(1.8, 1.0 + 0.5 × √25) = min(1.8, 1.0 + 2.5) = 1.8. The sum of the radius factors of the two scatter points is f_A + f_B = 3.6. If the squared distance between the two scatter points is dist² = 9.0, and the distance threshold is T = 1.0, then [T × (f_A + f_B)]² = [1.0 × 3.6]² = 12.96. Since dist² = 9.0 ≤ 12.96, scatter points A and B are determined to belong to the same cluster.
[0067] In this embodiment, a personalized radius factor is determined for each scatter point based on the amount of business data, and the sum of the radius factors of two scatter points and the distance threshold are jointly compared during clustering. This makes scatter points with larger amounts of business data have a greater aggregation influence in clustering, and the clustering results are more in line with actual business needs. At the same time, it also improves the flexibility and rationality of clustering.
[0068] In some embodiments, the amount of business data is positively correlated with the radius factor, and the upper limit of the radius factor is less than or equal to a specified upper limit.
[0069] Positive correlation means that the larger the volume of business data, the larger the radius factor. The specified upper bound is the maximum value that the radius factor is allowed to take. It is used to prevent scatter points with excessively large business data from generating excessively large radius factors, which would lead to unreasonable clustering results.
[0070] In practice, a square root function is used to achieve a positive correlation between the amount of business data and the radius factor. The specific formula is: f_i = min(f_max, f_base + k × √metric_i), where f_i is the radius factor of scatter point i, metric_i is the amount of business data corresponding to scatter point i, f_base is the base radius factor, k is an adjustment coefficient, and f_max is a specified upper limit (i.e., the upper limit of the radius factor). The advantage of using the square root function is that when the amount of business data is small, the radius factor increases significantly with the amount of business data, reflecting the differences between small-scale scatter points; when the amount of business data is large, the growth of the radius factor tends to be gradual, avoiding excessive expansion of the clustering influence of large-scale scatter points.
[0071] The maximum value f_max can be configured according to actual business needs, such as 1.8, 2.0, or 2.5. By setting a specified maximum value, the radius factor can be truncated (clamped), ensuring that even if the business data volume is very large (e.g., photoCount exceeds 10,000), the radius factor will not exceed the specified maximum value, thereby guaranteeing the stability of the clustering results and preventing a few extremely large scatter points from including a large number of irrelevant scatter points into their clusters.
[0072] For example, when an upper limit of f_max = 1.8 is specified, the radius factor will not exceed 1.8 regardless of whether the number of scattered photos is 200 or 20,000. This ensures the controllability and consistency of the clustering results.
[0073] In this embodiment, by setting a specified upper limit value for the radius factor, the positive correlation between the business data volume and the radius factor is reasonably constrained. This not only preserves the influence of the business data volume on the clustering results but also prevents clustering anomalies caused by extreme values, thus ensuring the stability and reliability of the clustering results.
[0074] In some embodiments, the method further includes: In response to a panning or zooming operation on the map, the labeling information of the clusters is hidden; in response to the panning or zooming operation stopping, the scattered points in each set are clustered again within a specified time period.
[0075] Pan operation refers to the user's action of changing the center position of the map display by dragging the mouse or swiping with the touch. Zoom operation refers to the user's action of changing the map zoom ratio by scrolling the mouse wheel, using two fingers to zoom, or using the zoom button. The specified duration refers to the waiting time after a pan or zoom operation stops, during which re-clustering is delayed; it is also known as the debounce interval.
[0076] In practice, when a user pans or zooms on the map, the label information of the currently displayed clusters is first hidden. Specific hiding methods may include: setting the business scatter plot layer to invisible (visibility=hidden), clearing the rendering data of the current clusters, and disabling the interaction event listeners for the business scatter plot layer. By hiding the label information, flickering or misaligned cluster labels can be avoided during map navigation, improving the visual experience.
[0077] After the user stops panning or zooming, a debounce timer is started. Within a specified duration (e.g., 240 milliseconds), the coordinates of the scattered points within the currently displayed area are reacquired, and clustering calculations are performed again. If the user initiates a new panning or zooming operation within the specified duration, the current debounce timer is canceled and restarted. This debounce mechanism avoids frequent triggering of clustering calculations when the user frequently interacts with the map, reducing unnecessary consumption of computational resources.
[0078] Furthermore, during the roaming process (i.e., while the user is panning or zooming), the business scatter points are suppressed. Specifically, during roaming, the data source of the business scatter point layer can be set to an empty array, pointer events of the business scatter point layer can be turned off, and the DOM elements that mark the scatter points can be hidden. These measures can avoid rendering performance issues caused by frequent refreshes of business scatter points during roaming.
[0079] For example, when a user drags and pans on a map, the cluster markers are immediately hidden after the drag is detected. The user stops dragging after 2 seconds, and within 240 milliseconds after stopping, the scatter points in the current viewport are reacquired and cluster calculations are performed. Then, the new cluster markers are displayed on the map.
[0080] In this embodiment, by hiding the label information of clusters during map panning or zooming operations and re-executing clustering within a specified time after the operation stops, the system suppresses business scatter points during roaming to avoid flickering. At the same time, the anti-jitter mechanism reduces the performance overhead caused by frequent clustering calculations, ensuring the smoothness of map operations and the real-time nature of clustering results.
[0081] In some embodiments, the further clustering of scatter points within each set includes: Assign a task number to the operation of clustering the scattered points in each set; in response to the completion of clustering, obtain the clustering result and determine whether the task number corresponding to the clustering result is consistent with the current latest task number; in response to the inconsistency between the task number corresponding to the clustering result and the current latest task number, discard the clustering result.
[0082] Here, the task number (sequence number, seq) is a unique, incrementing number assigned to each clustering operation, used to identify the relationship between old and new clustering tasks. The latest task number refers to the task number assigned when the most recent clustering operation was initiated.
[0083] In practice, the terminal device maintains a globally incrementing sequence counter (seq counter). Before each clustering operation, the sequence counter is incremented by 1, and the current sequence value is used as the task number for this clustering operation. Clustering operations can be executed in the main thread or in a background thread (such as a Web Worker). After the clustering operation is completed, the clustering result is obtained, along with the corresponding task number. This task number is then compared with the latest task number: if they match, it means the clustering result is calculated based on the latest viewport state, and the terminal device applies the clustering result to the map for rendering; if they do not match, it means the user initiated a new pan or zoom operation during the clustering calculation, the viewport state has changed, the clustering result is outdated, and it is discarded without rendering.
[0084] Furthermore, the terminal device can also check whether the current chart instance is consistent with the chart instance when the clustering operation was initiated. If they are inconsistent (for example, the user switched to a different chart page), the clustering result is also discarded. In addition, the terminal device can implement a self-healing mechanism: when it detects that a clustering result has been discarded, it can selectively trigger a recalculation, but set a maximum number of self-healing recalculations (e.g., a maximum of 5 times) to prevent infinite loops.
[0085] For example, if a user performs three zoom operations consecutively within a short period, the terminal device assigns task numbers seq=1, seq=2, and seq=3 to these three operations. When the clustering result corresponding to seq=1 is completed, the latest task number is seq=3, which is inconsistent, so the clustering result for seq=1 is discarded. When the clustering result corresponding to seq=3 is completed, the latest task number is still seq=3, which is consistent, so this clustering result is rendered onto the map.
[0086] In this embodiment, by configuring a monotonically increasing task number for each clustering operation and verifying the consistency of the task number after clustering is completed, the effect of preventing outdated clustering results from overwriting the latest viewport state is achieved, ensuring that the clustering results displayed on the map are always consistent with the current viewport state, and effectively solving the problem of old results overwriting new results in fast operation scenarios.
[0087] In some embodiments, the method further includes: In response to the total number of scatter points to be clustered being greater than or equal to a specified number, the clustering task of the scatter points to be clustered is executed in a background thread.
[0088] Here, a background thread refers to a computation thread that runs independently of the main thread, such as a Web Worker thread in a browser environment. The specified number refers to the threshold number of scatter points that trigger the background thread to perform the clustering task, for example, a value of 400.
[0089] In practice, after obtaining the scattered points within the current display area, the total number of scattered points to be clustered is first counted. When the total number of scattered points is greater than or equal to a specified number (e.g., 400), the scattered point data is serialized and sent to a background thread (WebWorker). The background thread then executes the aforementioned administrative region bucketing and BFS connected component clustering algorithms. After the calculation is completed, the clustering results are returned to the main thread for rendering via message passing (postMessage). When the total number of scattered points is less than the specified number, the clustering calculation is performed directly in the main thread to avoid the overhead of data transfer between threads.
[0090] By executing clustering tasks in a background thread, computationally intensive clustering algorithms can be offloaded from the main thread, preventing them from blocking rendering and user interaction processing on the main thread. In map applications, the main thread is responsible for map rendering, event handling, animation playback, and other tasks. If clustering calculations are performed on the main thread and the number of points is large, the main thread will be occupied for a long time, causing users to experience map lag and unresponsiveness. By offloading tasks to a background thread, the main thread can continue to respond to other user operations while waiting for clustering results, ensuring application smoothness.
[0091] For example, when a user views the scatter distribution of a province in the provincial view, the province contains 3,000 scatter points, which is greater than the specified number of 400. The coordinate data and business data of these 3,000 scatter points are sent to the Web Worker thread for clustering calculation. The main thread continues to process map rendering and user interaction. After the Web Worker returns the clustering results, the label information of the clusters is displayed on the map.
[0092] In this embodiment, by diverting the clustering task to a background thread when the number of scattered points to be clustered reaches a specified number, the page lag problem caused by blocking the main thread due to large-scale clustering calculation is avoided, ensuring the smoothness of the map application and the real-time response of user interaction.
[0093] In some embodiments, the method further includes: The average coordinates of all scattered points within the cluster are averaged to obtain the average position; the average position is used as the position of the cluster.
[0094] The average position refers to the arithmetic mean of the coordinates of all scattered points within a cluster, which is used to characterize the center position of the cluster on the map.
[0095] In practice, for each cluster, all scattered points within that cluster are traversed. The longitude values of all scattered points are summed and divided by the number of scattered points to obtain the average longitude; the latitude values of all scattered points are summed and divided by the number of scattered points to obtain the average latitude. The coordinates formed by the average longitude and average latitude are used as the location of the cluster, which is then used to display the cluster's label information on the map. For clusters containing only a single scattered point, the average location is the original coordinate position of that scattered point.
[0096] Furthermore, when calculating the average position, the business data within the cluster can be summarized. Specifically, for a cluster containing multiple scattered points, the business data volume of all scattered points within the cluster is summed to obtain the total business data volume of the cluster, which is then displayed in the tagging information. Simultaneously, detailed information (such as cell name, address, etc.) of the top N scattered points with the largest business data volume within the cluster can be collected as a summary of the cluster, which users can view after clicking the cluster tag.
[0097] For example, if a cluster contains 3 scatter points with coordinates (113.25, 23.13), (113.28, 23.15), and (113.30, 23.14), then the average position is ((113.25 + 113.28 + 113.30) / 3, (23.13 + 23.15 + 23.14) / 3) = (113.277, 23.140). The cluster's label information, including the number of scatter points "3", is displayed at this average position.
[0098] In this embodiment, the average position is obtained by averaging the coordinates of all scattered points within the cluster, and the average position is used as the position of the cluster for display. This allows the marked position of the cluster to accurately reflect the geographical center of the scattered points within the cluster, improving the accuracy and visual effect of the marked position.
[0099] In some embodiments, after obtaining the scatter coordinates and before performing clustering, the method further includes correcting the occupancy coordinates of special areas. Specifically, when the current base map is not a map specifically for Sansha City, business scatter points whose administrative attributes contain "Sansha" are identified, and their actual latitude and longitude are mapped to the preset anchor coordinates of the national map of the South China Sea or the preset anchor coordinates of the provincial base map.
[0100] The purpose of this is to address the fact that Sansha City, as an important administrative region in the South China Sea islands, administers islands and reefs scattered across a vast sea area. In actual map displays, national maps and most provincial base maps use a South China Sea thumbnail to represent Sansha City's location. Without coordinate correction, the scattered points of Sansha City would be invisible on national or provincial maps due to their actual latitude and longitude being far from the mainland, preventing users from seeing the distribution of these scattered points. By mapping the coordinates of the scattered points of Sansha City to the preset anchor point coordinates of the South China Sea thumbnail, these scattered points can participate normally in cluster calculations and map display, ensuring the visibility of scattered points in this special administrative region.
[0101] In this embodiment, by correcting the occupant coordinates of scattered points in special areas, scattered points in special administrative areas such as outlying islands can be displayed normally on the main map and participate in clustering, thus ensuring the integrity and accuracy of the map's scattered point display.
[0102] In some embodiments, the method further includes: when the current display area of the map changes, converting the administrative code corresponding to the current display area into a provincial code and a municipal code, and notifying the business system via a callback. Specifically, the terminal device reads the administrative code (adcode) corresponding to the top element of the map stack, extracts its first two digits as the provincial code, extracts its first four digits as the municipal code, and then notifies the business system of the provincial code and municipal code through a preset callback function, so that the business system can update the relevant business data display according to the current display area.
[0103] In this embodiment, the external synchronization mechanism for regional changes enables the business system to promptly know the user's current viewing area on the map, facilitating the linkage update of related data and improving the synergy between the map application and the business system.
[0104] In some embodiments, the method further includes: responding to a user's click operation on the labeling information of a cluster, determining the administrative code corresponding to the clicked location, and displaying the scattered distribution of the next level of administrative regions based on the administrative code. Specifically, the administrative code is determined according to a priority chain: the first priority is the administrative code directly carried by the click event; the second priority is the administrative code found through name normalization caching; the third priority is the administrative code obtained through source lookup on the base map; the fourth priority is the administrative code obtained through matching the city-level module key; and the fifth priority is the administrative code determined through semantic rules (such as rule mapping for special areas like the South China Sea and Sansha).
[0105] In this embodiment, a multi-priority administrative code parsing mechanism is used to ensure that the administrative region corresponding to the user's click location can be accurately parsed in different scenarios. This allows users to drill down from the national view to more granular view levels such as provinces, cities, and districts / counties, providing a smooth map exploration experience.
[0106] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0107] Based on the same inventive concept, corresponding to the map scatter display method provided in the embodiments of this application, this application also provides a map scatter display device.
[0108] refer to Figure 3 The map scatter display device includes: The acquisition module 301 is configured to acquire the current zoom level of the map and the coordinates of scattered points within the current display area of the map, wherein the current display area includes multiple administrative regions; Clustering module 302 is configured to determine a distance threshold based on the scaling ratio, divide the scattered points into multiple sets according to their administrative regions based on the coordinates, and cluster the scattered points in each set based on the distance threshold to obtain multiple clusters; Display module 303 is configured to display the labeling information of the corresponding clusters in each administrative region of the map, the labeling information of the clusters including the location of the clusters and the number of scatter points.
[0109] In one possible implementation, the clustering module 302 is used for: Get the administrative level of the currently displayed administrative region on the map; The distance threshold is determined based on the scaling ratio and the hierarchical level of the administrative region.
[0110] In another possible implementation, the clustering module 302 is used for: The radius factor of each scatter point is determined based on the amount of business data corresponding to each scatter point. For any two scattered points in the same set, if the distance between the two scattered points is less than or equal to the sum of the product of the distance threshold and the radius factor of each of the two scattered points, the two scattered points are determined to belong to the same cluster.
[0111] In another possible implementation, the amount of business data is positively correlated with the radius factor, and the upper limit of the radius factor is less than or equal to a specified upper limit value.
[0112] In another possible implementation, the clustering module 302 is further configured to: In response to panning or zooming operations on the map, the labeling information of the clusters is hidden; In response to the cessation of the translation or scaling operation, the scattered points within each set are clustered again within a specified time period.
[0113] In another possible implementation, the clustering module 302 is further configured to: Configure task numbers for the operation of clustering the scattered points within each set; In response to the completion of clustering, the clustering result is obtained, and it is determined whether the task number corresponding to the clustering result is consistent with the latest task number. If the task number corresponding to the clustering result is inconsistent with the latest task number, the clustering result is discarded.
[0114] In another possible implementation, the clustering module 302 is further configured to: In response to the total number of scatter points to be clustered being greater than or equal to a specified number, the clustering task of the scatter points to be clustered is executed in a background thread.
[0115] In another possible implementation, the display module 303 is used for: The average position is obtained by averaging the coordinates of all scattered points within the cluster. The average position is used as the position of the cluster.
[0116] It should be noted that the map scatter display device provided in the above embodiments is only illustrated by the division of the above functional modules when displaying map scatter points. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the map scatter display device and the map scatter display method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0117] Based on the same inventive concept, corresponding to the map scatter display method provided in the embodiments of this application, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the map scatter display method described in the above embodiments.
[0118] Figure 4 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0119] The processor 1010 can be implemented using a general-purpose CPU (central processing unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0120] The memory 1020 can be implemented in the form of ROM (read-only memory), RAM (random access memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0121] The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0122] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0123] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0124] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0125] The electronic device described above is used to implement the corresponding map scatter display method in the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0126] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions that can be executed by a processor in a terminal to complete the map scatter plot display method described above. This computer-readable storage medium can be non-transitory. For example, the computer-readable storage medium can be ROM (read-only memory), RAM (random access memory), CD-ROM (compact discread-only memory), magnetic tape, floppy disk, and optical data storage devices, etc.
[0127] In an exemplary embodiment, a computer program product is also provided, including computer program instructions that, when executed on a computer, cause the computer to perform the map scatter display method described in the above embodiments.
[0128] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals (including but not limited to signals transmitted between user terminals and other devices, etc.) involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0129] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0130] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.
[0131] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for displaying scatter points on a map, characterized in that, include: Obtain the current zoom level of the map and the coordinates of scattered points within the current display area of the map, where the current display area includes multiple administrative regions; Based on the scaling ratio, a distance threshold is determined. Based on the coordinates, the scattered points are divided into multiple sets according to their respective administrative regions. Based on the distance threshold, the scattered points in each set are clustered to obtain multiple clusters. The map displays the labeling information of the corresponding clusters in each administrative region. The labeling information of the clusters includes the location of the clusters and the number of scattered points.
2. The map scatter plot display method according to claim 1, characterized in that, Determining the distance threshold based on the scaling ratio includes: Get the administrative level of the currently displayed administrative region on the map; The distance threshold is determined based on the scaling ratio and the hierarchical level of the administrative region.
3. The map scatter plot display method according to claim 1, characterized in that, The clustering of scattered points within each set based on the distance threshold includes: The radius factor of each scatter point is determined based on the amount of business data corresponding to each scatter point. For any two scattered points in the same set, if the distance between the two scattered points is less than or equal to the sum of the product of the distance threshold and the radius factor of each of the two scattered points, the two scattered points are determined to belong to the same cluster.
4. The map scatter plot display method according to claim 3, characterized in that, The amount of business data is positively correlated with the radius factor, and the upper limit of the radius factor is less than or equal to a specified upper limit value.
5. The map scatter plot display method according to claim 1, characterized in that, The method further includes: In response to panning or zooming operations on the map, the labeling information of the clusters is hidden; In response to the cessation of the translation or scaling operation, the scattered points within each set are clustered again within a specified time period.
6. The map scatter plot display method according to claim 5, characterized in that, The next step of clustering the scattered points within each set includes: Configure task numbers for the operation of clustering the scattered points within each set; In response to the completion of clustering, the clustering result is obtained, and it is determined whether the task number corresponding to the clustering result is consistent with the latest task number. If the task number corresponding to the clustering result is inconsistent with the latest task number, the clustering result is discarded.
7. The map scatter plot display method according to any one of claims 1 to 6, characterized in that, The method further includes: In response to the total number of scatter points to be clustered being greater than or equal to a specified number, the clustering task of the scatter points to be clustered is executed in a background thread.
8. The map scatter plot display method according to any one of claims 1 to 6, characterized in that, The method further includes: The average position is obtained by averaging the coordinates of all scattered points within the cluster. The average position is used as the position of the cluster.
9. A map scatter plot display device, characterized in that, include: The acquisition module is configured to acquire the current zoom level of the map and the coordinates of scattered points within the current display area of the map, the current display area including multiple administrative regions; The clustering module is configured to determine a distance threshold based on the scaling ratio, divide the scattered points into multiple sets according to their respective administrative regions based on the coordinates, and cluster the scattered points in each set based on the distance threshold to obtain multiple clusters. The display module is configured to display the labeling information of the corresponding clusters in each administrative region of the map. The labeling information of the clusters includes the location of the clusters and the number of scatter points.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method described in any one of claims 1 to 8.
12. A computer program product comprising computer program instructions, characterized in that, When the computer program instructions are executed on a computer, the computer causes the computer to perform the method as described in any one of claims 1 to 8.
