Opened 13 years ago

Closed 13 years ago

#1136 closed defect (worksforme)

ST_distance_sphere producing unexpected results

Reported by: darkpanda Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:

Description

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.

Change History (1)

comment:1 by pramsey, 13 years ago

Resolution: worksforme
Status: newclosed

Pleased to report that current trunk also returns 0. So, will close this and hope you don't find other cases.

Note: See TracTickets for help on using tickets.