[postgis-tickets] [PostGIS] #2420: ST_LineToCurve turns squares into circles

PostGIS trac at osgeo.org
Sun Aug 11 08:55:09 PDT 2013


#2420: ST_LineToCurve turns squares into circles
---------------------+------------------------------------------------------
 Reporter:  strk     |       Owner:  strk         
     Type:  defect   |      Status:  assigned     
 Priority:  medium   |   Milestone:  PostGIS 2.0.4
Component:  postgis  |     Version:  1.5.X        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by strk):

 I have the change ready. You may compare this with the result from #2412
 where a LINESTRING with only 3 vertices would have raised an exception.
 Also see #2407 which is about symmetricity of LineToCurve and CurveToLine
 and ask yourself what would you want from a LineToCurve. Is it a geometric
 excercise ? In that case why not also returning a circle when given a
 3-vertex linestring ? Is that a way to save vertices while still retaining
 the original shape ? In that case for sure a circle is _not_ close enough
 to your starting triangle or square, is it ?

 I keep thinking there should be a minimum set of requirements to turn
 something to a curve.
 The number of edges ? The difference in extent from the original ? We have
 two cases of approximated curves produced by PostGIS. One is
 ST_CurveToLine which uses a default of 32 edges per quadrant, the other is
 ST_Buffer which uses a default of 8 edges per quadrant. Can't we safely
 use 2 segments per quadrant as the hardcoded bare minimum ?

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