<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to write geometries that are perfect circles? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148371#M11521</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Nick,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would it be possible in your workflow to create a point file and then use the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000800000019000000"&gt;buffer tool&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: Never mind, that is still not a perfect circle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit 2: I'm not sure if it is actually possible to create a perfect circle in a Shapefile. I think feature classes in geodatabases will accept perfect circles.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Apr 2014 12:43:48 GMT</pubDate>
    <dc:creator>JoshuaChisholm</dc:creator>
    <dc:date>2014-04-29T12:43:48Z</dc:date>
    <item>
      <title>How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148370#M11520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is anyone out there familiar with writing geometries that are perfect circles (..err should I say arcs?).&amp;nbsp; In one of my scripts I deconstruct, then reconstruct polygon features point by point.&amp;nbsp; It appears that some of my features are perfectly round and only contain two points.&amp;nbsp; So far, I've experimented quite a bit in Arc's Python Window and I've read ESRI's online help here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001v000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001v000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...but still stuck.&amp;nbsp; Is there a trick to writing perfectly round polygon features that I'm missing?&amp;nbsp; If anyone out there has any advice it'd be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please note that I'm restricted to ArcGIS for Desktop 10.0 and Python 2.6.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Nick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 11:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148370#M11520</guid>
      <dc:creator>NickJacob</dc:creator>
      <dc:date>2014-04-29T11:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148371#M11521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Nick,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would it be possible in your workflow to create a point file and then use the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000800000019000000"&gt;buffer tool&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: Never mind, that is still not a perfect circle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit 2: I'm not sure if it is actually possible to create a perfect circle in a Shapefile. I think feature classes in geodatabases will accept perfect circles.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 12:43:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148371#M11521</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2014-04-29T12:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148372#M11522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for responding Josh!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm more interested in how to write a circular geometry from scratch using only two point points.&amp;nbsp; I guess it doesn't necessarily need to be a perfect circle.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 13:54:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148372#M11522</guid>
      <dc:creator>NickJacob</dc:creator>
      <dc:date>2014-04-29T13:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148373#M11523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;pntGeom = arcpy.PointGeometry(arcpy.Point(2000, 2500))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;circleGeom = pntGeom.buffer(100)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 15:45:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148373#M11523</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-04-29T15:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148374#M11524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you interested in a "true curve" circle or a "densified" circle? The former will have two verticies (the start/end nodes) and a mathematical equation that describes the line that connects the nodes. The densified circle will have a whole bunch of verticies that in sum approximate a circle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's some code that might help....&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;pntGeom = arcpy.PointGeometry(arcpy.Point(2000, 2000)) #substitute your centroid x/y coordinates circleGeom = pntGeom.buffer(100) #substitute the distance from your circles verticies to the centroid arcpy.CopyFeatures_management(circleGeom, r"C:\temp\test.gdb\test) # copying to a GDB will preserve the "true curve" geometry arcpy.CopyFeatures_management(circleGeom, r"C:\temp\test.shp) # copying to a .shp will force densification&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 15:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148374#M11524</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-04-29T15:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148375#M11525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Chris!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would have never thought of that, but your code makes perfect sense.&amp;nbsp; Let me ask you this - is it possible to read that kind of information from a 'true curve' circle using a search cursor?&amp;nbsp; I've experimented in the Python Window a little bit but wasn't able to find a object with that .buffer attribute.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Nick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 16:30:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148375#M11525</guid>
      <dc:creator>NickJacob</dc:creator>
      <dc:date>2014-04-29T16:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148376#M11526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unless something has changed in the latest versions of ArcMap, Python geometries cannot access true curve information and destroy it, since you can only access the vertices of the geometry and it assumes straight lines exist between them.&amp;nbsp; .Net applications can access true curves information through the geometry interfaces it provides.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 16:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148376#M11526</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-04-29T16:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148377#M11527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another somewhat brute force method I found here &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/5574/how-to-create-a-circle-in-arcpy" rel="nofollow noopener noreferrer" target="_blank"&gt;http://gis.stackexchange.com/questions/5574/how-to-create-a-circle-in-arcpy&lt;/A&gt;&lt;SPAN&gt; uses a little trigonometry to make your circle.&amp;nbsp; It's not technically a true circle though, it's actually 100 lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import math, arcpy

def circle_poly(x,y,r): 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(100):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ang = float(i)/100 * math.pi * 2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yield (x + r * math.cos(ang), y + r * math.sin(ang) )

pointArray = arcpy.Array()
for (x,y) in circle_poly(-121.4543,43.972,100):
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointArray.add(arcpy.Point(x,y))

circlePolygon = arcpy.Polygon(pointArray, arcpy.SpatialReference(4326))

outFC = arcpy.CreateFeatureclass_management("in_memory","circle","POLYGON")
arcpy.DefineProjection_management(outFC, arcpy.SpatialReference(4326))
cursor = arcpy.da.InsertCursor(outFC, ["SHAPE@"])
cursor.insertRow([circlePolygon])

del cursor
del circlePolygon
del pointArray&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris's solution is definitely the way to go, but I found this method interesting anyways.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:02:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148377#M11527</guid>
      <dc:creator>MattEiben</dc:creator>
      <dc:date>2021-12-11T08:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write geometries that are perfect circles?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148378#M11528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;is it possible to read that kind of information from a 'true curve' circle using a search cursor&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As far as I know, you cannot access the "equation" for true curves via Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Interestingly enough, I noted that (assuming you are using the code from my example above):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; circleGeom.getPart(0) #will yield&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;Array [&amp;lt;Point (2000.0, 2100.0, #, #)&amp;gt;, &amp;lt;Point (2000.0, 2100.0, #, #)&amp;gt;]&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; circleGeom.JSON #(or .WKT) will yield all the densified verticies...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;u'{"rings":[[[2000,2100],[2003.1099862269837,2099.9516282291988],[2006.216963743148,2099.8065597133595],[2009.3179267484072,2099.564934796902],[2012.4098752613259,2099.2269872363277],[2015.4898180214084,2098.7930439740758],[2018.5547753829494,2098.2635248222264],[2021.6017821976484,2097.6389420563605],[2024.6278906832001,2096.9198999199666],[2027.6301732750831,2096.1070940398727],[2030.6057254587888,2095.201310753273].....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A somewhat related topic: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/49557-True-Curves-True-Evil"&gt;http://forums.arcgis.com/threads/49557-True-Curves-True-Evil&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 17:30:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-write-geometries-that-are-perfect-circles/m-p/148378#M11528</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-04-29T17:30:38Z</dc:date>
    </item>
  </channel>
</rss>

