[postgis-devel] [PostGIS] #1136: ST_distance_sphere producing unexpected results

PostGIS trac at osgeo.org
Wed Jul 20 14:17:31 PDT 2011


#1136: ST_distance_sphere producing unexpected results
-----------------------+----------------------------------------------------
 Reporter:  darkpanda  |       Owner:  pramsey      
     Type:  defect     |      Status:  new          
 Priority:  medium     |   Milestone:  PostGIS 2.0.0
Component:  postgis    |     Version:  trunk        
 Keywords:             |  
-----------------------+----------------------------------------------------
 As discussed here: http://postgis.refractions.net/pipermail/postgis-
 devel/2011-July/014460.html

 I was just messing around with the latest PostGIS 2.0 trunk and was
 running a unit test suite I have and noticed that ST_distance_sphere
 is returning some strange results. Here's the query I was running:

 {{{
 SELECT ST_distance_sphere('POLYGON((-5 -5,-5 5,5 5,5 -5,-5 -5))', 'POINT(1
 1)');
 }}}

 Which results in 444712.466496141 in the current trunk.
 postgis_full_version() says:

 {{{
 POSTGIS="2.0.0SVN" GEOS="3.3.0-CAPI-1.7.0" PROJ="Rel. 4.7.1, 23 September
 2009" LIBXML="2.7.8" USE_STATS
 }}}

 Whereas in PostGIS 1.5.3 I see a result of 0. postgis_full_version():

 {{{
 POSTGIS="1.5.3" GEOS="3.3.0-CAPI-1.7.0" PROJ="Rel. 4.7.1, 23 September
 2009" LIBXML="2.7.8" USE_STATS
 }}}

 Both PostGIS installs are on the same PostgreSQL 9.0.4 server.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1136>
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