[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] DISTANCE function doesn't work at 179,-179
From:       Paul Ramsey <pramsey () refractions ! net>
Date:       2003-10-22 16:20:23
Message-ID: 3F96AE47.4020002 () refractions ! net
[Download RAW message or body]

We do not handle lat/lon as if they are on a sphere, we do it as if they 
are on a plane. Doing things in spherical is a PITA. Basically we would 
need a whole separate mode for calculations which carefully dealt with 
the singularity points in lat/lon.

P.

Andrew Edmondson wrote:
> 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>
> 


-- 
       __
      /
      | Paul Ramsey
      | Refractions Research
      | Email: pramsey@refractions.net
      | Phone: (250) 885-0632
      \_


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic