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

PostGIS trac at osgeo.org
Mon Oct 13 06:52:48 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  |  
---------------------------------------+------------------------------------

Comment(by gitai):

 I'm new to postgis, not gis ... and no your wrong, the function behaves
 differently as result of an overload *as well as* an implicit default
 parameter - which makes it a tricky interface.

 Furthermore, your explanation does not seem consistent with how ST_DWithin
 works:

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

 -- output: 0.234024137979163

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

 -- output: 20013.836017253

 select ST_DWithin(ST_SetSRID(ST_MakePoint(-73.9662500, 40.7834300), 4326),
 ST_SetSRID(ST_MakePoint(-73.9662500, 40.7834300), 4326), 20 * 1000)

 -- output: t

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