I'm trying to change the coordinate system of a batch of feature classes to 'Geodetic datum GDA94(code=4283) using Define Projection. I receive no python error message and no change to the coordinate system, just lists returned from ListFeatureClasses and ListWorkspaces. My code is below. Can someone suggest why Define Projection isn't converting the data it receives?
import arcpy
from arcpy import env
import os
#set path where the shapefiles are located
arcpy.env.workspace = "Z:/temp"
#returns @string list of GDB folders
workspaces = arcpy.ListWorkspaces('*', "FileGDB")
for item in workspaces:
print item
env.workspace = item
#returns @string list of feature classes
fcs = arcpy.ListFeatureClasses()
for file in fcs:
print '\t', file
# set local variables
for file in fcs:
inData = file
coordinateSystem = arcpy.SpatialReference(4283)
arcpy.DefineProjection_management(inData, coordinateSystem)
Best Answer
You appear to be confusing two tools:
I suspect that it is the Project tool which you should be using here.