Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import arcpy
  2.  
  3. # A list of features and coordinate pairs
  4. feature_info = [[[1, 2], [2, 4], [3, 7]],
  5. [[6, 8], [5, 7], [7, 2], [9, 5]]]
  6.  
  7. # A list that will hold each of the Polygon objects
  8. features = []
  9.  
  10. for feature in feature_info:
  11. # Create a Polygon object based on the array of points
  12. # Append to the list of Polygon objects
  13. features.append[0:6]
  14. arcpy.Polygon(
  15. arcpy.Array([arcpy.Point(*coords) for coords in feature]))
  16.  
  17. # Persist a copy of the Polyline objects using CopyFeatures
  18. arcpy.CopyFeatures_management(features, "c:/PYTHON_CLASS/Assignment3/polygons.shp")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement