Skip to main content
added 229 characters in body
Source Link
Marc Pfister
  • 4.1k
  • 17
  • 11

This will give your problemsI assume you want to loop through all the feature classes you're collecting, so it should be:

out_coordinate_system# we only need to do this once
hkfc = "C:\Wiley\P1\gis\HK80.gdb\Building_merge_dissolved"
desc = arcpy.SpatialReferenceDescribe('spatialRef.name'hkfc)

The argument doesn't need quotes:

out_coordinate_systemspatialRef = desc.spatialReference

for input in fc:
    output = os.path.join(outdir, os.path.basename(input) + "_project")    
    arcpy.SpatialReferenceProject_management(input, output, spatialRef.name) 

The way you're using walk is a little awkward but should be functional.

This will give your problems:

out_coordinate_system = arcpy.SpatialReference('spatialRef.name')

The argument doesn't need quotes:

out_coordinate_system = arcpy.SpatialReference(spatialRef.name)

I assume you want to loop through all the feature classes you're collecting, so it should be:

# we only need to do this once
hkfc = "C:\Wiley\P1\gis\HK80.gdb\Building_merge_dissolved"
desc = arcpy.Describe(hkfc)
spatialRef = desc.spatialReference

for input in fc:
    output = os.path.join(outdir, os.path.basename(input) + "_project")    
    arcpy.Project_management(input, output, spatialRef) 

The way you're using walk is a little awkward but should be functional.

Source Link
Marc Pfister
  • 4.1k
  • 17
  • 11

This will give your problems:

out_coordinate_system = arcpy.SpatialReference('spatialRef.name')

The argument doesn't need quotes:

out_coordinate_system = arcpy.SpatialReference(spatialRef.name)