Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Points, Lines, and Polygons on Spheres with C/C++ [closed]

My application is to represent shapes on the Earth's (using a sphere is sufficient) surface. Those can be points, lines, and polygons. Coordinates should be defined by using degrees or radians (just like geographic coordinates).

A line segment between two points on the surface of sphere should lie on its great circle. Polygons should consist of a collection of the such lines. Furthermore, I would like to perform Set - Basic Operations like intersection, union, difference, complement on the shapes mentioned. These operations only need to output collections of points.

I tried to figure that out using CGAL's 3D Spherical Geometry Kernel and 2D Boolean Operations on Nef Polygons Embedded on the Sphere. Actually, I already had problems with putting a line on the sphere. Additionally CGAL works in the Euclidean Space, which still leaves me with the geometric operations necessary, to work with great circles placed on the sphere.

My question is, if you can assist me in realizing the functionality mentioned in CGAL or if you can recommend another library for C/C++ that does that. Thank you very much!

like image 581
user327684 Avatar asked Apr 28 '10 10:04

user327684


1 Answers

I'd suggest you to take a look at this:

http://www.codeguru.com/Cpp/Cpp/algorithms/general/article.php/c5115/

The question 1E solves your problem of intersection between two grand circles. From this you can define the basic operation of your shapes on the sphere without a big dependency like CGAL or GEOS.

like image 83
Vitor Py Avatar answered Sep 18 '22 21:09

Vitor Py