daily pastebin goal
78%
SHARE
TWEET

BatchProj

a guest Oct 1st, 2015 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #-------------------------------------------------------------------------------
  2. # Name:        Batch Project
  3. # Purpose:     Batch Project Feature Classes
  4. #
  5. # Author:      noah.huntington
  6. #
  7. # Created:     29/04/2015
  8. # Copyright:   (c) noah.huntington 2015
  9. # Licence:     <your licence>
  10. #-------------------------------------------------------------------------------
  11. import arcpy
  12.  
  13. # Local variables:
  14. workspace = arcpy.env.workspace = arcpy.GetParameterAsText(0)
  15. outPath = arcpy.CreateFolder_management(arcpy.GetParameterAsText(1), arcpy.GetParameterAsText(2))
  16.  
  17. # Use the ListFeatureClasses function to return a list of
  18. #  shapefiles.
  19. featureclasses = arcpy.ListFeatureClasses()
  20.  
  21. dataset = arcpy.GetParameterAsText(3)
  22. spatial_ref = arcpy.Describe(dataset).spatialReference
  23.  
  24. # Copy shapefiles to a file geodatabase
  25. for fc in featureclasses:
  26.     project_list = []
  27.     project_list.append(fc)
  28.     arcpy.BatchProject_management(project_list,outPath,spatial_ref)
RAW Paste Data
Top