<div dir="ltr">For what it's worth: I noticed that the old behaviour of <span style="font-size:12.8px">segs_per_quadrant caused some topologies to break because the segments were not of equal length. When polygons are neighbouring eachother in a topological manner, the new segments vertices will not align with the neighbour when running ST_CurveToLine on both polygons, since the line direction is opposite. (GDAL does it correct, making every segment in the former curve of equal length).</span><div><span style="font-size:12.8px">If this behaviour can be tackled in new functionality that would be great.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 13, 2017 at 11:12 AM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@kbt.io" target="_blank">strk@kbt.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've started work on extended functionality for ST_CurveToLine [1]<br>
to allow for specifying max-error instead of segments-per-quadrant [2]<br>
and balancing of output segments [3].<br>
<br>
[1] <a href="https://postgis.net/docs/ST_CurveToLine.html" rel="noreferrer" target="_blank">https://postgis.net/docs/ST_<wbr>CurveToLine.html</a><br>
[2] <a href="https://trac.osgeo.org/postgis/ticket/2464" rel="noreferrer" target="_blank">https://trac.osgeo.org/<wbr>postgis/ticket/2464</a><br>
[3] <a href="https://trac.osgeo.org/postgis/ticket/3772" rel="noreferrer" target="_blank">https://trac.osgeo.org/<wbr>postgis/ticket/3772</a><br>
<br>
Current API is:<br>
<br>
  ST_CurveToLine(geom) -- defaults to 32 segs-per-quadrant<br>
  ST_CurveToLine(geom, integer segs_per_quadrant)<br>
<br>
The proposed new API would be:<br>
<br>
  ST_CurveToLine(geom geometry,<br>
          tolerance float8 = 32,<br>
          tolerance_interpretation int = 0,<br>
          balanced bool=true)<br>
<br>
The tolerance_intepretation parameter could initially<br>
support these values:<br>
<br>
  0 - segments per quarter circle<br>
  1 - maximum distance beween segment and curve<br>
<br>
Leaving the door open to futher extensions (for example<br>
QGIS also supports "maximum angle between segments").<br>
<br>
The default values would also allow for the new signature<br>
to replace the existing ones, so to have a single signature.<br>
<br>
Of course the code would then need to perform some consistency<br>
checking, like not accepting a non-integer value as tolerance<br>
when "segments-per-quarter-cirlce" interpretation is requested.<br>
<br>
What do you think about the proposal ?<br>
<br>
--strk;<br>
______________________________<wbr>_________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-devel</a></blockquote></div><br></div>