<html><head></head><body><div>Hello Tom</div><div><br></div><div>I see your point.</div><div>The reason it is implemented this way is that I didn't think about it and that it will be more complicated.</div><div><br></div><div>More complicated, both because it would need different handling of linestrings and polygons. </div><div>It will also add some extra complexity to grab the second point in the polygon when calculating the last point of the polygon. </div><div>Also, if it shows that the start/end point should be eliminated it means what is the start and end of the polygon. </div><div>The second point of the polygon or the second last point of the polygon. Then that point shall be duplicated and put as first or last point.</div><div><br></div><div>It is of course doable, but will open some possibilities for problems. </div><div>I haven't looked at the code for some years so I cannot say how much work it would mean.</div><div><br></div><div>Now it sets the first/last point and the 2 most valuable points in a polygon to DBL_MAX to prevent collapse. If the start/end point is not always used it also have to save another point as the third point to avoid collapse.</div><div>For linestrings it does the same with the first and last point and that prevents collapse.</div><div><br></div><div>What you can do is open a ticket about it.</div><div>I you have a patch it is great, or it will be set as "PostGIS Fund Me"</div><div><br></div><div>I agree at first thought that what you suggest would make sense and would be the right thing.</div><div><br></div><div>ATB</div><div><br></div><div>Nicklas Avén</div><div><br></div><div><br></div><div><br></div><div>On Sun, 2017-10-15 at 12:22 +0200, Tom van Tilburg wrote:</div><blockquote type="cite"><div dir="ltr"><div>I only just found this out and was wondering if it is intentional. When running ST_SetEffectiveArea it turns out that the triangle-area for points related to start and endpoint of a polygon are set to dbl_max (example below). While this is logical for linestrings (it would break your network), I think it could be implemented better for polygons by reconnecting the polygon when start/endpoint are throw out because of a small effective area. I have some polygons with spikes originating from the startpoint and it is unexpected behaviour to see some spikes not being removed this way.</div><div>Is there a good reason to keep the start/endpoint of polygon intact? And if so, would it make sense to make it optional?</div><div><br></div><div>Tom<br></div><div><br></div><div>P.S. I have the idea that this point has been addressed on another list (maybe D3) but wasn't able to find it. </div><div><br></div><div>----------------------</div><div>Example:</div><div><br></div><div><font face="monospace, monospace">SELECT</font></div><div><font face="monospace, monospace"> ST_AsTExt(</font></div><div><font face="monospace, monospace"> (ST_DumpPoints(</font></div><div><font face="monospace, monospace"> ST_SetEffectiveArea(</font></div><div><font face="monospace, monospace"> ST_GeometryFromText(</font></div><div><font face="monospace, monospace">'POLYGON((</font></div><div><font face="monospace, monospace">0 0,</font></div><div><font face="monospace, monospace">10 0,</font></div><div><font face="monospace, monospace">20 0,</font></div><div><font face="monospace, monospace">20 10,</font></div><div><font face="monospace, monospace">10 10,</font></div><div><font face="monospace, monospace">10 0,</font></div><div><font face="monospace, monospace">0 0</font></div><div><font face="monospace, monospace">))'</font></div><div><font face="monospace, monospace"> )</font></div><div><font face="monospace, monospace"> ,0.1)</font></div><div><font face="monospace, monospace">)).geom)</font></div><div><br></div><div>Result:</div><div><div><font face="monospace, monospace">"POINT M (0 0 3.40282346638529e+38)"</font></div><div><font face="monospace, monospace">"POINT M (20 0 3.40282346638529e+38)"</font></div><div><font face="monospace, monospace">"POINT M (20 10 3.40282346638529e+38)"</font></div><div><font face="monospace, monospace">"POINT M (10 10 50)"</font></div><div><font face="monospace, monospace">"POINT M (10 0 50)"</font></div><div><font face="monospace, monospace">"POINT M (0 0 3.40282346638529e+38)"</font></div></div><div><br></div></div>
</blockquote></body></html>