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 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): arcpy.Append_management(polygon, output) else: arcpy.CopyFeatures_management(polygon, output)
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.