The distance function doesn't know what coordinate system you are using. It 
expects it to be flat, not spherical. (ie. it expects your coordinates to be 
meters/feet/miles, not degrees)

You want distance_spheroid(). Read the docs for it and also length_spheroid() 
here:

http://postgis.refractions.net/docs/x927.html

I'm still not certain that you will get the right answer, but at least the 
answer you get won't be in degrees.

Chris

Quoting Andrew Edmondson <a.edmondson@eris.qinetiq.com>:

> I have two points either side of the 180 degree line on a sphere. (example
> included)
> Calling DISTANCE on them, doesn't yield the result 2, but rather 357...
> Have I not actually got a sphere?
> Or does DISTANCE not do what I expect?
> 
> Thanks,
> 
> -Ed
> 
> <example>
> 
> test=# SELECT * FROM location;;
>  location_id | latlong
> -------------+--------------------------
>            1 |  SRID=4278;POINT(0 0)
>            2 |  SRID=4278;POINT(0 90)
>            3 |  SRID=4278;POINT(0 179)
>            4 |  SRID=4278;POINT(0 -179)
> (4 rows)
> 
> test=# SELECT DISTANCE(latlong, GeometryFromText('POINT(0 178)',4278)) from
> location;
>      distance
> ------------------
>               178
>                88
>                 1
>               357
> (4 rows)
> 
> </example>
> 
> --
> ##############################################################################
> Andrew Edmondson
> PGP Key:
> http://search.keyserver.net:11371/pks/lookup?op=get&search=0xCEE814DC
> PGP Fingerprint: 7B32 4D1E AC4F 29E2 9EAA 9550 1A3D BBA4 CEE8 14DC
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 





