Map point aggregation optimization scheme and map aggregation optimization scheme

Source: Internet
Author: User

Map point aggregation optimization scheme and map aggregation optimization scheme
Http://www.cnblogs.com/lbser/p/4417127.html Aggregation

The query results on a map are usually displayed as marked points. However, if there are many marked points, the rendering time of the client is greatly increased, making the client very slow, it also produces intensive phobias (figure 1 ). To solve this problem, we need a means to display the most comprehensive information within the user's limited visible region without overlapping coverage.

Figure 1

Ii. Tried solution --- kmeans

Intuitively, we can use clustering algorithms to better achieve our goals. Therefore, we use simple kmeans clustering. Based on the client's request, we know the range displayed by the client, fetch the data in this range from the index engine, perform kmeans clustering on the data, and finally return the result to the client.

However, after going online, we found that the kmeans effect was not satisfactory. There are two main disadvantages.

A) performance problems

Kmeans is a computing-intensive algorithm that can be completed only after multiple iterations. In addition, complex Distance Computing is involved in each iteration, which consumes cpu resources.

We encountered a high load problem after going online.

B) performance issues

Kmeans cannot completely solve the overlap overwrite problem! We can see that some aggregated icons are stacked together.

Iii. Optimization Scheme

Review our purpose again: we need a means to display the most comprehensive information in the smallest area within the user's limited visible area without overlapping coverage.

3.1. Direct Grid Method

When solving the problems related to geographical space, it is often difficult to use the method of space partitioning and grid.

Principle: Divide the MAP range into a square of the specified size (different sizes for each scaling level), and combine the points in the corresponding grid into the square (center of the square ), in the end, only one center point is displayed in a square, and the number of original points contained in the aggregation point is displayed.

How can we place a vertex in a square? We use this formula to map the size of the space to 100*100.

Advantages: The computation speed is fast. Each original vertex only needs to be calculated once without complicated distance calculation.

Disadvantages: Sometimes very close points are forced to be separated in different aggregation points only because of the network demarcation line. In addition, the location of aggregation points is the center of the grid, instead of the center of the grid, the aggregated points may not accurately reflect the original point information.

3.2. Grid Distance Method

Principle: Follow solution 1: 1) place each point in the corresponding Square; 2) solve the center of each grid; 3) Merge the center: Determine whether each center is within a certain range, if it is within a certain range, it is merged.

How can we determine whether each center point needs to be merged? Take point A as an example to draw A rectangle or circle range. B and C fall into the range. Therefore, A, B, and C are merged.

Advantages: The computation speed is equally fast. Compared with solution 1, the two steps of solving the centroid and merging the centroid are much simpler and can be completed quickly.

3.3. Direct Distance Method

Principle: There are no known aggregation points at the beginning, and then iteration is performed on each point to calculate the outsourcing square of a point. If the outsourcing square of this point does not intersection the outsourcing square of the existing aggregation point, create an aggregation point (this is not to calculate the distance between a point, but to calculate an outsourcing square of a point. The length of a square is specified by the user or a default value is set by the Program, the point is aggregated to the aggregation point. If the point and the outsourcing square of multiple known aggregation points intersect, the distance from the point to the aggregation point is calculated, aggregate to the nearest aggregation point until all vertices are traversed. Each scaling level re-traverses all original vertex elements.

Advantages: The computation speed is relatively fast. Each original vertex only needs to be calculated once. It may be a bit away from the vertex. The aggregated vertex accurately reflects the location information of the elements of the original vertex.

Disadvantages: The speed is not as fast as the speed based entirely on the grid. This method also has a disadvantage, that the final result is different because of the different iteration sequence of each point. Therefore, the issue of developing the iteration sequence is involved.

 

 

3.4. K-D tree method

This method needs to combine PCA (Principal Component Analysis) and K-D tree, the effect is better, but the performance is poor, the implementation is more complex. Http://applidium.com/en/news/too_many_pins_on_your_map)

References

Https://developers.google.com/maps/articles/toomanymarkers

Http://applidium.com/en/news/too_many_pins_on_your_map/

Research on mark point Aggregation Algorithm Based on Baidu Map

Point aggregation algorithm and current situation of online map

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.