##Script Name: Project shapefiles (batch) ##Description: project multiple shapefiles ##Created By: Elaine Kuo ##Date: 08/05/2012 #Import standard library modules import arcgisscripting import os #Create the Geoprocessor object gp = arcgisscripting.create(9.3) #Set the input workspace #GP.workspace = sys.argv[1] #Set the workspace. gp.Workspace= "H:/temp/test1" #Set the output workspace #outWorkspace = sys.argv[2] #Set the workspace. List all of the feature classes in the dataset outWorkspace= "H:/temp" # Set the spatial reference variable cs = "C:/Program Files/ArcGIS/Coordinate Systems/Geographic Coordinate Systems/World/WGS 1984.prj" #Get a list of the featureclasses in the input folder fcs = gp.ListFeatureClasses() # Loop through every item in the list that was just generated for fc in fcs: # Break out the name, no path or extension, using the describe object. desc = gp.describe(fc) featureName = desc.name # Make featureclasses as layers outFeatureClass = outWorkspace + os.sep + gp.ValidateTableName(featureName, outWorkspace) gp.Toolbox = "management" gp.Project(fc, outFeatureClass, cs)
Solved! Go to Solution.
Thanks for the answer.
1. transformation:
It is not in need to change from Behrmann WGS 1984 to WGS 1984.
(Please kindly correct me if it is wrong.)
2. Also thanks for not hardcoding the path.
However, my version is ArcGIS 9.3
Please kindly suggest any modification from ArcGIS 10 to 9.3.
# Set the spatial reference variable prjHome = arcpy.GetInstallInfo()["InstallDir"] cs = prjHome + "/Coordinate Systems/Geographic Coordinate Systems/World/WGS 1984.prj"
Thanks for the answer.
1. transformation:
It is not in need to change from Behrmann WGS 1984 to WGS 1984.
(Please kindly correct me if it is wrong.)
2. Also thanks for not hardcoding the path.
However, my version is ArcGIS 9.3
Please kindly suggest any modification from ArcGIS 10 to 9.3.