[postgis-tickets] [PostGIS] #4326: Circular strings distances are wrong

PostGIS trac at osgeo.org
Fri May 7 06:58:10 PDT 2021


#4326: Circular strings distances are wrong
----------------------+---------------------------
  Reporter:  komzpa   |      Owner:  strk
      Type:  defect   |     Status:  reopened
  Priority:  medium   |  Milestone:  PostGIS 2.5.3
 Component:  postgis  |    Version:  2.4.x
Resolution:           |   Keywords:
----------------------+---------------------------
Changes (by robe):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 As noted by abobov on IRC this returns 0 instead of some non-zero answer


 {{{
 WITH DATA AS (SELECT 'SRID=3857;CURVEPOLYGON(CIRCULARSTRING(7874821
 8715927,8907663 8715927,8844683 7750316,7937800 7750316,7874821
 8715927))'::geometry AS a,
                      'SRID=3857;Point (5433865 8243495)'::geometry AS b)

 SELECT st_distance(a, b), a && b AS bbox_intersect FROM DATA;
 }}}

 Returns:


 {{{
 0  false
 }}}



 I would expect it to return something in ballpark of applying
 ST_LineToCurve answer:


 {{{
 WITH DATA AS (SELECT
 ST_CurveToLine('SRID=3857;CURVEPOLYGON(CIRCULARSTRING(7874821
 8715927,8907663 8715927,8844683 7750316,7937800 7750316,7874821
 8715927))'::geometry) AS a,
                      'SRID=3857;Point (5433865 8243495)'::geometry AS b)

 SELECT st_distance(a, b) FROM DATA;
 }}}

 which returns:


 {{{
 2271892.5770899933
 }}}

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