[postgis-tickets] [PostGIS] #4336: ST_LineToCurve generates wrong Arcs for Epsilon 1E-1 (+ potential fix)

PostGIS trac at osgeo.org
Thu Apr 25 11:56:32 PDT 2019


#4336: ST_LineToCurve generates wrong Arcs for Epsilon  1E-1 (+ potential fix)
-------------------------+---------------------------
  Reporter:  tvijlbrief  |      Owner:  pramsey
      Type:  defect      |     Status:  new
  Priority:  medium      |  Milestone:  PostGIS 2.5.3
 Component:  postgis     |    Version:  2.4.x
Resolution:              |   Keywords:
-------------------------+---------------------------

Comment (by pramsey):

 `ST_LineToCurve()` generates curves from lines that are stroked from
 curves (collections of linear segments that can be approximated with a
 similar curve. When I run:

 `select st_astext(st_linetocurve('LINESTRING(147581.256
 468550.143,147578.59 468548.055,147575.584 468540.815,147574.293
 468538.813,147573.024 468537.369,147546.127 468516.624,147521.175
 468497.798,147609.007 468486.657,147609.55 468486.638,147610.088
 468486.717,147610.602 468486.892,147611.077 468487.156,147611.496
 468487.502,147611.845 468487.918,147612.114 468488.391,147612.293
 468488.904,147612.377 468489.44,147612.363 468489.984,147612.25
 468490.515,147612.044 468491.018,147607.368 468500,147581.256
 468550.143)'::geometry))`

 I get back

 `LINESTRING(147581.256 468550.143,147578.59 468548.055,147575.584
 468540.815,147574.293 468538.813,147573.024 468537.369,147546.127
 468516.624,147521.175 468497.798,147609.007 468486.657,147609.55
 468486.638,147610.088 468486.717,147610.602 468486.892,147611.077
 468487.156,147611.496 468487.502,147611.845 468487.918,147612.114
 468488.391,147612.293 468488.904,147612.377 468489.44,147612.363
 468489.984,147612.25 468490.515,147612.044 468491.018,147607.368
 468500,147581.256 468550.143)`

 which is the same as the input. The function is saying there's not enough
 similarity in the edges to approximate a curve so it's returning the input
 untouched. The `ST_LineToCurve()` also doesn't take an epsilon, though
 `ST_CurveToLine()` does.

 Can you summarize your issue with the smallest possible collection of SQL
 and data? I can't keep tossing darts at the board and hoping I get the
 right combination.

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