2

AST folder has 5 shapefiles. This code tries to pass the 2100 coordinate system to these shapefiles. But it gives error 999999:

arcpy.env.workspace = r"C:\Users\user\Desktop\roads\AST" 
for i in arcpy.ListFeatureClasses():
     sr = arcpy.SpatialReference("EPSG:2100")
     arcpy.DefineProjection_management(i, sr)

How to make it work?

0
0

Instead of:

sr = arcpy.SpatialReference("EPSG:2100")

try:

sr = arcpy.SpatialReference(2100)

Do ArcGIS SpatialReference object factory codes correspond with EPSG numbers? is worth reviewing for information about using EPSG codes in ArcMap.

Not the answer you're looking for? Browse other questions tagged or ask your own question.