Gridded triangle and KNN graph on the Sphere

Source: Internet
Author: User
In this blog, we have discussed the relationship between the Dirichlet triangle and the canvas, and the corresponding concepts can be defined on the sphere. These geometric structures are often useful because we live on the ground ball.

Consider the following question: where is the farthest place from the border in China? After some thought, I think it is feasible to solve this problem by using the KNN graph on the sphere. (There may be a better way. I hope you can tell me .)

The calculation of the gridded triangle and KNN graphs on the sphere is achieved by calculating the convex hull in a three-dimensional space. For more information, seeArticle(Recommended link 1 and link 2 ). The tool I use is cgal. The data of the national border line comes from http://www.gelib.com/world-borders.htm. Data from all over the world is simple. The portion of China is listed separately in Mainland China and Hong Kong, Macao, and Taiwan regions. Is the national border data:

 

With data and convenient tools, the rest is actually extremely simple. I want to writeProgramTo display the results, and later found that it is much easier to write the results as kml files and use Google Earth to display them. Convert each data point from the latitude and longitude value to a three-dimensional point distributed on the unit ball. Calculate the convex packets of these points. If the normal vector of the triangle surface of the convex hull points to the exterior of the convex hull, the triangular surface of the convex vector facing the ball is projected onto the sphere, then we can get the world's inner triangle. After the triangle surface is normalized to units, the dual vertex of the corresponding Dirichlet triangle can be obtained from the ball center offset by this vector. Traverse the edges on the convex hull surface and use the dual vertex of the adjacent triangle to connect the circular arc with the center of the ball center to generate the KNN graph on the sphere. For example:

 

Medial Axis can also be calculated as follows:

 

Return to the problem at the beginning-the farthest place from the border. That is, the dual vertex corresponding to the largest outer circle in the triangle. If it is not in China or abroad, it is in the Pacific Ocean to the west of Chile. The longitude is 76.1677 ° and the latitude is 40.7443 °. The distance is about 8723 km (calculated based on the Earth's radius equal to 6371km, the same below ). To get the farthest place in China from the border, you only need to consider the Dirichlet triangle in the country. This point is east longitude 108.173 °, north latitude 32.479 °, in Hanzhong City, Shaanxi ProvinceZhenba County, about 1050 km away.

The above calculation may be inaccurate because the data used is relatively simple, but the method should be correct.

Finally, we will attach a beautiful example (Firewall should be turned over) related to the domain name of the domain name over the sphere using meshlab ).

 

Download link(All the above results are included, excluding the overseas line data. decompress the package and open it with Google Earth)

Source code

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.