[postgis-devel] [PostGIS] #657: Spheroid/Ellipsoid projection given Lat/Lon, Distance & Bearing

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


#657: Spheroid/Ellipsoid projection given Lat/Lon, Distance & Bearing
--------------------------+-------------------------------------------------
  Reporter:  lwilmen      |       Owner:  pramsey                                      
      Type:  enhancement  |      Status:  closed                                       
  Priority:  critical     |   Milestone:  PostGIS 2.0.0                                
 Component:  postgis      |     Version:  1.5.X                                        
Resolution:  fixed        |    Keywords:  bearing distance liblwgeom spheroid ellipsoid
--------------------------+-------------------------------------------------

Comment(by realityexists):

 Thanks! I tried out the new ST_Project function in r8577 together with
 ST_Azimuth. If ST_Azimuth is changed to return radians (consistent with
 the geometry overload) then I think ST_Project should also take a bearing
 in radians. Either way, would be nice to explicitly document it, eg. "The
 distance is given in meters ''and the azimuth in ...''".

 A few other issues:

 1) ST_Project can return a point outside of the (-180,180) range, which
 then fails when passed to other functions, eg.

 `SELECT ST_Project('POINT(175 10)'::geography, 2000000, 90)`
     => POINT(193.223435218359 9.50463611585127)
 `SELECT ST_AsText(ST_Project('POINT(175 10)'::geography, 2000000,
 90))::geography`
     => ERROR:  Coordinate values are out of range [-180 -90, 180 90] for
 GEOGRAPHY type

 2) `SELECT ST_Distance(ST_Project('POINT(10 10)'::geography, 10, 0),
 'POINT(10 10)'::geography)`
     => ERROR:  gbox_overlaps: cannot compare geodetic and non-geodetic
 boxes

 3) ST_DWithin doesn't work with the returned point.
 `SELECT ST_DWithin(ST_Project('POINT(10 10)'::geography, 2000, 90),
 'POINT(10 10)'::geography, 2000)`
     => false
 `SELECT ST_DWithin(ST_AsText(ST_Project('POINT(10 10)'::geography, 2000,
 90))::geography, 'POINT(10 10)'::geography, 2000)`
     => true

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/657#comment:5>
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