Guest User

BatchProj

a guest
Oct 1st, 2015
208
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×