# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# DEMProjection.py
# Created on: 2016-05-19 09:55:46.00000
# Generated by ArcGIS/ModelBuilder / Edited to ArcPy
# Usage: DEMProjection <Unprojected_DEM_Workspace> <Name_Projected_DEM__Add_file_path_and__Name__> <Output_Coordinate_System>
# Build Help Links: http://gis.stackexchange.com/questions/100184/batch-raster-conversion;
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy, os, sys

# Script arguments
in_Folder = arcpy.GetParameterAsText(0) # set unprojected raster directory
out_Folder = arcpy.GetParameterAsText(1) # set projected raster directory
out_SR = arcpy.GetParameterAsText(2) # set output raster coordinate system

arcpy.env.workspace = in_Folder

rasterlist = arcpy.ListRasters()
for raster in rasterlist:
    arcpy.AddMessage("Projecting " + raster)
    #out_dem_name = os.path.join(out_Folder, raster + "_p")
    arcpy.ProjectRaster_management(in_Folder + "\\" + raster, out_Folder + "\\" + raster, out_SR, "NEAREST", "", "", "", "")

arcpy.AddMessage("Projection complete")