<div dir="ltr"><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">I have been using PostGIS to generate mathematical diagrams. One of the first things I needed was a table of points evenly spaced around a circle. This seemed easy to do using ST_Buffer and exploding the geometry with ST_DumpPoints to get what I needed. I came up with this:</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><br></span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">WITH pts AS (</span><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"> SELECT
st_dumppoints.path,<span style="font-size:11pt"> </span><span style="font-size:11pt">st_dumppoints.geom</span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"> FROM
st_dumppoints(st_buffer(st_geomfromtext('POINT(0 0)'), (100), 12))
st_dumppoints(path, geom)</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"> )</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"> SELECT pts.path[2] AS
path, <span style="font-size:11pt"> </span><span style="font-size:11pt">st_x(pts.geom) AS
x,</span><span style="font-size:11pt"> </span><span style="font-size:11pt">st_y(pts.geom) AS
y,</span><span style="font-size:11pt"> </span><span style="font-size:11pt">pts.geom</span><span style="font-size:11pt"> </span><span style="font-size:11pt">FROM pts</span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">This was intended to get 48 points (12*4) evenly spaced around a point at (0.0) with a radius of 100. The query above gives 49 points which makes sense (the starting point is duplicated). However, if you increase the parameter to 13, you get 54 points instead of the expected 53. The last few lines of the above query using 13 is:</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br>52 99.27088740980523 12.053668025533685 "0101000000BE80253856D1584022041D607A1B2840"<br>53 100 1.445577598596648e-12 "01010000000000000000005940000000804D6E793D"<br>54 100 0 "010100000000000000000059400000000000000000"<br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">The buffer operation is generating an extra vertex & a segment with a length of
1.445577598596648e-12. </p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">Using 14 for the parameter gives 57 points as expected, but every other parameter greater than 14 gives the extra point. I am not sure this qualifies as a bug but an extra tiny segment might cause issues with intersections and is_valid.</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">Thanks</p></div>