Skip to content

Instantly share code, notes, and snippets.

@cindygis
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cindygis/487a2b0a9d809560765d to your computer and use it in GitHub Desktop.
Save cindygis/487a2b0a9d809560765d to your computer and use it in GitHub Desktop.
Defines the projection for a folder of shapefiles.
import arcpy
arcpy.env.workspace = r"C:\Some\Arb\Folder"
# Define spatial reference WGS 84
sr = arcpy.SpatialReference(4326)
for shp in arcpy.ListFeatureClasses():
arcpy.management.DefineProjection(shp, sr)
print("Defined " + shp)
print("Script complete").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment