[Proj] proj4 string for perfect sphere

Demitri Muna thatsanicehatyouhave at me.com
Fri Apr 13 15:57:10 PDT 2012


Hi,

I'm an astronomer and I'm exploring the possibility of using GIS tools (specifically spatialite at the moment) with astronomical objects. I'm not conversant in GIS at the moment (or really the whole field), but I've made a little progress.

It seems that I need an appropriate SRID for what I'm doing. I want a perfect sphere, I'm working exclusively in degrees (a lat/lon analogy to ra/dec seems fine), and all of my points can be considered on the surface of the sphere. What SRID would be appropriate for this description?

I came up with this (probably laughably simplistic):

+proj=moll +ellps=sphere

In spatialite using that SRID (or none at all for that matter), I did this:

CREATE TABLE data (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
coordinate BLOB
);

INSERT INTO data (name, coordinate) VALUES ('NGC23',GeomFromText('POINT(2.47254166667 25.9237777778)'));
INSERT INTO data (name, coordinate) VALUES ('NGC17',GeomFromText('POINT(2.77729166667 -12.1073136111)'));

These are degree values, and when I did this:

SELECT name, DISTANCE( GeomFromText('POINT(2.77729166667 -12.1073136111)'), coordinate ) FROM data;

I get:

NGC23       38.0323123776791                                                         
NGC17       0.0               

which apparently is the distance on a flat x-y cartesian plane, not the angular (or great circle) distance I'm looking for (38.0322481853 degrees).

Is the wrong SRID the problem in the first place?

Cheers,
Demitri




More information about the Proj mailing list