[postgis-devel] [PostGIS] #1305: ST_Azimuth on the spheroid

PostGIS trac at osgeo.org
Thu Dec 29 23:12:52 PST 2011


#1305: ST_Azimuth on the spheroid
----------------------------+-----------------------------------------------
  Reporter:  realityexists  |       Owner:  pramsey      
      Type:  enhancement    |      Status:  closed       
  Priority:  medium         |   Milestone:  PostGIS 2.0.0
 Component:  postgis        |     Version:  1.5.X        
Resolution:  fixed          |    Keywords:               
----------------------------+-----------------------------------------------

Comment(by realityexists):

 Thanks for implementing this, Paul! I tried out r8577 (Windows) today and
 found a couple of issues:

 1) ST_Azimuth(geography) returns degrees, but ST_Azimuth(geometry) returns
 radians. This should probably be consistent to reduce programmer errors
 and follow the principle of least surprise.

 2) When the two points are equal ST_Azimuth(geography) returns NaN, while
 ST_Azimuth(geometry) return NULL. This should be consistent, too. I would
 strongly recommend that both overloads return 0, because passing NULL and
 NaN into ST_Project makes it return NULL and "POINT(nan nan)",
 respectively. That means every programmer using ST_Azimuth and ST_Project
 must be aware of this special case and code around it.
 `ST_Project('POINT(10 10)'::geography, 0, 0)` returns 'POINT(10 10)' as
 expected.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1305#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list