2

This question already has an answer here:

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?

marked as duplicate by Vince, BERA, Evil Genius, Kadir Şahbaz, PolyGeo arcpy Aug 28 '18 at 12:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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.