I have over 100 shape files that don't have .prj file and thus when I bring them into ArcMap 10 they show the coordinate system as unknown. I know all of the shape files coordinate system is GCS WGS 1984. I also know I can use the Define Projection GP tool to individually assign the coordinate system to each file but that will take forever.
I was hoping there was a GP tool to batch define these but I don't see one. Next I was thinking maybe I could use python to do this so I looked in the help menu and found a script but it gives me an error.
Here is the python code I tried (this is for a single shp file so I would still have the pain of typing the name for each file:
import arcpy
infc = r"C:\Documents and Settings\User\My Documents\ArcGIS\shpfiles\Site_2.shp"
prjfile = r"\Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"
arcpy.DefineProjection_management(infc, prjfile)
Answer
I think you guys are overthinking this one...
- Right-click on the "Define Projection" tool in toolbox,
- select "Batch",
- drag-and-drop your layers into the "Input Dataset" column,
- right-click in the first "Coordinate System" box to fill out the correct projection,
- then right-click on the projection you just selected and choose "Fill" which will fill out all of the rest of the projections for you.
- Hit "OK" and you are done.
No comments:
Post a Comment