AnsweredAssumed Answered

gp.project not working with shorthand of prj

Question asked by helenak on May 14, 2012
Latest reply on May 15, 2012 by curtvprice
System ArcGIS 9.3

Problem

I tried to project using shorthand of 1984 prj.
However, it failed and said
ERROR 999999: Error executing function.
A locator with this name does not exist.
Failed to execute (Project).

Please kindly explain the error cause and advise any modification in need of the code below.
Thanks a lot.

##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)

Outcomes