The S2 Geometry Library is a spherical geometry library, useful for manipulating regions on the sphere (commonly on Earth) and indexing geographic data. For an analogous library in C++, please see http://code.google.com/p/s2-geometry-library/.