Defining projections for multiple shapefiles in ArcMap?

I think you guys are overthinking this one...

  1. Right-click on the "Define Projection" tool in toolbox,
  2. select "Batch",
  3. drag-and-drop your layers into the "Input Dataset" column,
  4. right-click in the first "Coordinate System" box to fill out the correct projection,
  5. 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.
  6. Hit "OK" and you are done.

alt text


If they are in the same directory, something like this would work (just replace your paths, maybe add in some exception handling):

import os, shutil

wgs84prjpath='c:/Program Files/ArcGIS/Desktop10.0/Coordinate Systems/Geographic Coordinate Systems/World/WGS 1984.prj'

def definewgs84(shpfilepath):
    tgtpath = os.path.splitext(shpfilepath)[0] + '.prj'
    shutil.copyfile(wgs84prjpath,tgtpath)


yourshapefiledirectory='C:/temp/'
extension='shp'

shpfileslist = [file for file in os.listdir(yourshapefiledirectory) if file.lower().endswith(extension)]

for filename in shpfileslist:
    definewgs84(os.path.join(yourshapefiledirectory,filename))

Just make copies of the .prj and rename. So, e.g., if you have 3 shapefiles:

  • one.shp,
  • two.shp,
  • three.shp.

Define the projection for one.shp and you will have one.prj in the directory. Copy one.prj to the directory of two.shp and rename to two.prj, repeat for all shapefiles. The .prj is just a text file. As long as there is a .prj in the same directory as a .shp and with the same name, the software will pick it up. Automate with whatever tools you are familiar with for copying and renaming files.