pgSphere is a server side module for PostgreSQL. It contains methods for working with spherical coordinates and objects. It also supports indexing of spherical objects.