<?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: Create a polygon shapefile in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-a-polygon-shapefile/m-p/136391#M10696</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's actually a pretty simple setup, you can use the link that mzcoyle posted and it can help you. It should end up looking something like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Import arcpy

SpatialReference = #Your Spatial Reference of choice, ie. WGS 1984
Output = #the place you want to put it, as well as the name. If you are doing multiple coordinates and individual shapefiles but all in the same folder, you can setup a workspace.


Lowerleft = a
Lowerright = b
Upperright = c
Upperleft = d

array = arcpy.Array()
array.add(Lowerleft)
array.add(Lowerright)
array.add(Upperright)
array.add(Upperleft)
array.add(Lowerleft)
polygon = arcpy.Polygon(array, SpatialReference)
#this next step is if you want to have&amp;nbsp; it be in different shapefiles or all in one. Also if you are running this as a tool in ArcGIS that a user can use, instead of putting in set variables, use Arcpy.GetParameterAsText() The number inside the paranthesis (starting at 0) will be the order that you set them up in the tool when you create it in ArcGIS.
if arcpy.Exists(output):
&amp;nbsp; arcpy.Append_management(polygon, output)
else:
&amp;nbsp; arcpy.CopyFeatures_management(polygon, output)
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;That should help you get a start on it. Let me know if you have any questions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:35:36 GMT</pubDate>
    <dc:creator>PatrickFischer1</dc:creator>
    <dc:date>2021-12-11T07:35:36Z</dc:date>
    <item>
      <title>Create a polygon shapefile</title>
      <link>https://community.esri.com/t5/python-questions/create-a-polygon-shapefile/m-p/136389#M10694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have four points say a {51.646932,5.053536}, b{51.645907,5.051111} , c{51.644695,5.051283} and d{51.644735,5.055017}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to python and want to know how to create a polygon with the help of these four points using arcpy?&amp;nbsp; I want to insert these hard coded values in the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When i run the script i would like that it should&amp;nbsp; save the newly created polygon shapefile to a location i specify.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;nigel.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 09:25:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-polygon-shapefile/m-p/136389#M10694</guid>
      <dc:creator>NigelDsouza</dc:creator>
      <dc:date>2013-03-07T09:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a polygon shapefile</title>
      <link>https://community.esri.com/t5/python-questions/create-a-polygon-shapefile/m-p/136390#M10695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See the code sample at the bottom of this help page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000061000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000061000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 12:19:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-polygon-shapefile/m-p/136390#M10695</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-03-07T12:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a polygon shapefile</title>
      <link>https://community.esri.com/t5/python-questions/create-a-polygon-shapefile/m-p/136391#M10696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's actually a pretty simple setup, you can use the link that mzcoyle posted and it can help you. It should end up looking something like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Import arcpy

SpatialReference = #Your Spatial Reference of choice, ie. WGS 1984
Output = #the place you want to put it, as well as the name. If you are doing multiple coordinates and individual shapefiles but all in the same folder, you can setup a workspace.


Lowerleft = a
Lowerright = b
Upperright = c
Upperleft = d

array = arcpy.Array()
array.add(Lowerleft)
array.add(Lowerright)
array.add(Upperright)
array.add(Upperleft)
array.add(Lowerleft)
polygon = arcpy.Polygon(array, SpatialReference)
#this next step is if you want to have&amp;nbsp; it be in different shapefiles or all in one. Also if you are running this as a tool in ArcGIS that a user can use, instead of putting in set variables, use Arcpy.GetParameterAsText() The number inside the paranthesis (starting at 0) will be the order that you set them up in the tool when you create it in ArcGIS.
if arcpy.Exists(output):
&amp;nbsp; arcpy.Append_management(polygon, output)
else:
&amp;nbsp; arcpy.CopyFeatures_management(polygon, output)
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;That should help you get a start on it. Let me know if you have any questions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:35:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-polygon-shapefile/m-p/136391#M10696</guid>
      <dc:creator>PatrickFischer1</dc:creator>
      <dc:date>2021-12-11T07:35:36Z</dc:date>
    </item>
  </channel>
</rss>

