<div dir="ltr">Thanks to all of you very much for your insightful replies!<div><br></div><div>The circles are computer-generated with 15-20 points (I should've mentioned that from the beginning).</div><div><br></div><div>I very much like the compactness-approach as well as the LineToCurve.</div><div><br></div><div>I will try out these approaches and let you know about my solution.</div><div><br></div><div>Again thank you very much, this mailing list is impressive and I hope I will be able to contribute as well.</div><div><br></div><div>Very best from Berlin,</div><div>Wolfgang</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 February 2015 at 19:56, Brent Wood <span dir="ltr"><<a href="mailto:pcreso@pcreso.com" target="_blank">pcreso@pcreso.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div><span></span></div><div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><br><div><div><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><span class=""><div><br><br></div><div>> I have many different polygons in my database and would like to know if<br clear="none">> there's any way to find out if a polygon has the shape of a circle. I<br clear="none">> searched both on Google and in the Postgis documentation but couldn't find<br clear="none"><div>> someone with the same question.</div></div><div><br clear="none"></div></span><div dir="ltr">The "lines" joining the vertices of a polygon are straight - so implicitly any polygon defined by a sequence of points is NOT a circle, but might approximate one. Also, a reprojected circle may no longer be round. Any circle can be defined by three points, but a triangle is not a circle :-)<br clear="none"></div><div><br clear="none"></div><div dir="ltr">If what you are asking is whether each vertex in the polygon boundary is the same distance from the centroid - that might be done relatively easily.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Something along the lines of (off the top of my head - this will need work to work):</div><div dir="ltr">select count(distinct(ST_Distance(ST_Centroid(geom),((ST_DumpPoints(ST_exteriorRing(geom))).geom)))) <br clear="none"></div><div><br clear="none"></div><div dir="ltr">for each polygon get the vertices, then get the distance between each vertex & the centroid, then see how many distinct distances there are for each feature, if only one you have a circle - the distance being the radius.<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">If precision becomes a problem with near zero differences creating 
apparently different radii for the polygon, you can select where max(dist) -
 min(dist) < a_very_small_number instead of all being the same. </div><div dir="ltr"><br clear="none"></div><div dir="ltr">Cheers<span class="HOEnZb"><font color="#888888"><br clear="none"></font></span></div><span class="HOEnZb"><font color="#888888"><div dir="ltr"><br clear="none"></div><div dir="ltr">Brent Wood<div><br clear="none"></div></div><div><div dir="ltr"><br clear="none"></div></div></font></span></div></div></div><br><br></div> </div> </div>  </div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>