Opened 11 years ago

Closed 7 years ago

#2464 closed enhancement (fixed)

st_curvetoline maxError instead of segments/quarter paramter

Reported by: mjurce Owned by: strk
Priority: medium Milestone: PostGIS 2.4.0
Component: postgis Version: master
Keywords: curves Cc:

Description

Let the function compute the number of segments per quarter respect to the error approximation given from the user. The number of segments should dpend on the circle curvature. The fixed parmeter "segm/quarter circle" is not always good with big and flat arcs.

The error parameter could be the max distance between the segment and the arc.

Change History (9)

comment:1 by pramsey, 11 years ago

Milestone: PostGIS 2.2.0
Priority: mediumlow
Type: defectenhancement
Version: 2.0.xtrunk

comment:2 by strk, 11 years ago

Keywords: curves added

Implementing this would allow to support conversion of 3-points lines to curves #2627

comment:3 by mjurce, 11 years ago

The maxError " maxDist(chord,arc) with n points segmentation could be computed: maxError=r*(1-cos( theta/(2*(n+1)) ) )

Solving for "maxError" should give:

nPoints = theta/(2*acos(1- maxError/r))

Someone could check if this is correct? Then is easy to plug-in into arc segmentizer. The angle increment will be given from this formula.

comment:4 by pramsey, 10 years ago

Owner: changed from pramsey to strk

comment:5 by strk, 10 years ago

Milestone: PostGIS 2.2.0PostGIS Future

comment:7 by strk, 7 years ago

Milestone: PostGIS FuturePostGIS 2.4.0
Priority: lowmedium
Status: newassigned

comment:9 by strk, 7 years ago

Resolution: fixed
Status: assignedclosed

In 15430:

Implement extended ST_CurveToLine signature

Adds lwcurve_linearize function at liblwgeom level.
Turns lwgeom_stroke into a wrapper, keept it for backward compatibility.
Reduces allocations in linearization procedures.

Implements SYMMETRIC and RETAIN_ANGLE flags.
Implements MAX_DEVIATION, MAX_ANGLE and SEGS_PER_QUADRANT configs.

Includes unit and SQL tests.
Includes documentation.

Closes #2464 (maxError configuration is MAX_DEVIATION)
Closes #3772 (balanced output is SYMMETRIC and RETAIN_ANGLE flags)

Document the new ST_CurveToLine signature

Note: See TracTickets for help on using tickets.