<?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: ArcPy Circle Function in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-circle-function/m-p/1481556#M83998</link>
    <description>&lt;LI-CODE lang="python"&gt;def _circle(radius=100, clockwise=True, theta=1, xc=0.0, yc=0.0):
    """Produce a circle/ellipse depending on parameters.

    Requires
    --------
    `radius` : number
        in projected units
    `clockwise` : boolean
        True for clockwise (outer rings), False for counter-clockwise
        (for inner rings)
    `theta` : number
        Angle spacing. If theta=1, angles between -180 to 180, are returned
        in 1 degree increments. The endpoint is excluded.

    Returns:
    -------
      list of coordinates for the circle/ellipse

    Notes:
    ------
     You can also use np.linspace if you want to specify point numbers.
     np.linspace(start, stop, num=50, endpoint=True, retstep=False)
     np.linspace(-180, 180, num=720, endpoint=True, retstep=False)
    """
    import numpy as np
    if clockwise:
        angles = np.deg2rad(np.arange(180.0, -180.0-theta, step=-theta))
    else:
        angles = np.deg2rad(np.arange(-180.0, 180.0+theta, step=theta))
    x_s = radius*np.cos(angles)            # X values
    y_s = radius*np.sin(angles) * scale    # Y values
    pnts = np.c_[x_s, y_s]
    pnts = pnts + [xc, yc]
    return pnts&lt;/LI-CODE&gt;&lt;P&gt;Then feed the points into&lt;/P&gt;&lt;LI-CODE lang="python"&gt;array = arcpy.Array([arcpy.Point(*coords) for coords in pnts])
rec = arcpy.Polygon(array)  # or Polyline&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 30 May 2024 20:20:50 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2024-05-30T20:20:50Z</dc:date>
    <item>
      <title>ArcPy Circle Function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-circle-function/m-p/1481464#M83991</link>
      <description>&lt;P&gt;I am trying to create inset maps using ArcPy and I want them to be circles, but I don't know how to create a circular function the same way a rectangle function was up on the GraphicElement Documentation.&lt;/P&gt;&lt;P&gt;This is the code for a rectangle that was on the documentation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;def&lt;/SPAN&gt; &lt;SPAN class=""&gt;MakeRec_LL&lt;/SPAN&gt;&lt;SPAN class=""&gt;(llx, lly, w, h)&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;xyRecList = [[llx, lly], [llx, lly+h], [llx+w,lly+h], [llx+w,lly], [llx,lly]]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;xyRecList = [[&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;],[&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;], [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2.75&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;], [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2.75&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;], [&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;]]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;array = arcpy.Array([arcpy.Point(*coords) &lt;/SPAN&gt;&lt;SPAN class=""&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; coords &lt;/SPAN&gt;&lt;SPAN class=""&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; xyRecList]) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;rec = arcpy.Polygon(array) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; rec &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;p = arcpy.mp.ArcGISProject(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'CURRENT'&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;#Create a layout&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lyt = p.createLayout(&lt;/SPAN&gt;&lt;SPAN class=""&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;'INCH'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;'New Layout with Rectangles'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone know how to replicate this process, but for circles instead?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 18:33:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-circle-function/m-p/1481464#M83991</guid>
      <dc:creator>YahyaMasri</dc:creator>
      <dc:date>2024-05-30T18:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Circle Function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-circle-function/m-p/1481512#M83994</link>
      <description>&lt;P&gt;Not sure about layouts, but You can use the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/buffer.htm#:~:text=Desktop%20Advanced%20license.-,Parameters,-Dialog" target="_self"&gt;arcpy.analysis.buffer&lt;/A&gt; function to create circular polygons using a point and radius.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 19:15:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-circle-function/m-p/1481512#M83994</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-05-30T19:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Circle Function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-circle-function/m-p/1481556#M83998</link>
      <description>&lt;LI-CODE lang="python"&gt;def _circle(radius=100, clockwise=True, theta=1, xc=0.0, yc=0.0):
    """Produce a circle/ellipse depending on parameters.

    Requires
    --------
    `radius` : number
        in projected units
    `clockwise` : boolean
        True for clockwise (outer rings), False for counter-clockwise
        (for inner rings)
    `theta` : number
        Angle spacing. If theta=1, angles between -180 to 180, are returned
        in 1 degree increments. The endpoint is excluded.

    Returns:
    -------
      list of coordinates for the circle/ellipse

    Notes:
    ------
     You can also use np.linspace if you want to specify point numbers.
     np.linspace(start, stop, num=50, endpoint=True, retstep=False)
     np.linspace(-180, 180, num=720, endpoint=True, retstep=False)
    """
    import numpy as np
    if clockwise:
        angles = np.deg2rad(np.arange(180.0, -180.0-theta, step=-theta))
    else:
        angles = np.deg2rad(np.arange(-180.0, 180.0+theta, step=theta))
    x_s = radius*np.cos(angles)            # X values
    y_s = radius*np.sin(angles) * scale    # Y values
    pnts = np.c_[x_s, y_s]
    pnts = pnts + [xc, yc]
    return pnts&lt;/LI-CODE&gt;&lt;P&gt;Then feed the points into&lt;/P&gt;&lt;LI-CODE lang="python"&gt;array = arcpy.Array([arcpy.Point(*coords) for coords in pnts])
rec = arcpy.Polygon(array)  # or Polyline&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 May 2024 20:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-circle-function/m-p/1481556#M83998</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-05-30T20:20:50Z</dc:date>
    </item>
  </channel>
</rss>

