[postgis-tickets] [PostGIS] #2965: ST_Distance, use_spheroid default

PostGIS trac at osgeo.org
Mon Oct 13 05:23:45 PDT 2014


#2965: ST_Distance, use_spheroid default
---------------------------------------+------------------------------------
 Reporter:  gitai                      |       Owner:  pramsey      
     Type:  defect                     |      Status:  new          
 Priority:  critical                   |   Milestone:  PostGIS 2.1.5
Component:  postgis                    |     Version:  2.1.x        
 Keywords:  ST_Distance, use_spheroid  |  
---------------------------------------+------------------------------------
 Per docs:

 http://postgis.net/docs/ST_Distance.html

 "..For geography type defaults to return spheroidal minimum distance
 between two geographies in meters.
 ..For geography type defaults to return the minimum distance around WGS 84
 spheroid between two geographies in meters. Pass in false to return answer
 in sphere instead of spheroid."

 Test:

 select ST_Distance(ST_SetSRID(ST_MakePoint(-73.9662500, 40.7834300),
 4326), ST_SetSRID(ST_MakePoint(-74.1960983, 40.739418), 4326));

 -- output (looks like a bug): 0.234024137979163

 select ST_Distance(ST_SetSRID(ST_MakePoint(-73.9662500, 40.7834300),
 4326), ST_SetSRID(ST_MakePoint(-74.1960983, 40.739418), 4326), false);

 -- output: 19967.534156972

 select ST_Distance(ST_SetSRID(ST_MakePoint(-73.9662500, 40.7834300),
 4326), ST_SetSRID(ST_MakePoint(-74.1960983, 40.739418), 4326), true);

 -- output: 20013.836017253

 Env:

 Win 8.1

 pgAdmin III v1.18.1

 PostgreSQL 9.3.5, compiled by Visual C++ build 1600, 64-bit (EDB)


 POSTGIS="2.1.3 r12547" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6
 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8"
 LIBJSON="UNKNOWN" RASTER

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2965>
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-tickets mailing list