[postgis-tickets] [PostGIS] #3201: ST_DistanceSphere uses SRID to obtain spheroid

PostGIS trac at osgeo.org
Thu Jul 16 23:25:44 PDT 2015


#3201: ST_DistanceSphere uses SRID to obtain spheroid
---------------------------+---------------------------
 Reporter:  mwtoews        |      Owner:  robe
     Type:  defect         |     Status:  new
 Priority:  medium         |  Milestone:  PostGIS 2.2.0
Component:  documentation  |    Version:  trunk
 Keywords:                 |
---------------------------+---------------------------
 The manual claims that "[ST_DistanceSphere] currently does not look at the
 SRID of a geometry and will always assume its in WGS 84 long lat."
 However, since PostGIS 2.0, it does use a valid SRID to get the spheroid.

 Compare this, using PostGIS 2.0:
 {{{
 SELECT
   ST_Distance_Sphere(p1, p2) AS default,
   ST_Distance_Sphere(ST_SetSRID(p1, 4326), ST_SetSRID(p2, 4326)) AS
 wgs_84,
   ST_Distance_Sphere(ST_SetSRID(p1, 4269), ST_SetSRID(p2, 4269)) AS
 grs_1980
 FROM (
     SELECT ST_MakePoint(0, 0) AS p1, ST_MakePoint(0, 1) AS p2
 ) f;
 -[ RECORD 1 ]--------------
 default  | 111195.079734632
 wgs_84   | 111195.079734632
 grs_1980 | 111195.079734022
 }}}
 The distances for unknown SRID and WGS84 are identical. But are different
 for GRS80.

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