Looped through the directory of GeoTif files and convert GeoTif to ArcGIS raster format.
Removed "NoData" raster cells using the ArcGIS Con statement; and projected the data to WGS 1984 UTM Zone 11.
**** Ascii to ArcRaster & Project Pyramids (Python Script)****
# ---------------------------------------------------------------------------
# ascii_to_arcraster_project_pyramids_stand_alone.py
# Created on: Tuesday Oct 04 2006
# Nadine Golden
# ---------------------------------------------------------------------------
# Import system modules
import glob, sys, string, os, win32com.client
# Create the Geoprocessor object
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
# Load required toolboxes...
gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
gp.AddToolbox("E:/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
files = glob.glob("F:/test/grids/*asc")
for file in files:
(basename, ext) = os.path.splitext(file)
ingrid = file
outgrid = basename + "tmp"
os.system("scii_to_arcraster_project_pyramids_stand_alone.py %s %s" % (ingrid, outgrid))
# Process: ASCII to Raster...
gp.ASCIIToRaster_conversion(ingrid, outgrid, "INTEGER")
## # Process: Define Projection...
## gp.DefineProjection_management(outgrid, "PROJCS['NAD_1983_UTM_Zone_11N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',
SPHEROID['GRS_1980',6378137.0,298.257222101]],
PRIMEM['Greenwich',0.0],
UNIT['Degree',0.0174532925199433]],
PROJECTION['Transverse_Mercator'],
PARAMETER['False_Easting',500000.0],
PARAMETER['False_Northing',0.0],
PARAMETER['Central_Meridian',-117.0],
PARAMETER['Scale_Factor',0.9996],
PARAMETER['Latitude_Of_Origin',0.0],
UNIT['Meter',1.0]]")
# Process: Project Raster...
finalgrid = basename
gp.ProjectRaster_management(outgrid, finalgrid, "PROJCS['WGS_1984_UTM_Zone_11N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',
SPHEROID['WGS_1984',6378137.0,298.257223563]],
PRIMEM['Greenwich',0.0],
UNIT['Degree',0.0174532925199433]],
PROJECTION['Transverse_Mercator'],
PARAMETER['False_Easting',500000.0],
PARAMETER['False_Northing',0.0],
PARAMETER['Central_Meridian',-117.0],
PARAMETER['Scale_Factor',0.9996],
PARAMETER['Latitude_Of_Origin',0.0],
UNIT['Meter',1.0]];
-10000 -10000 100000;0 100000;0 100000", "NEAREST", "1")
# Process: Build Pyramids...
gp.BuildPyramids_management(finalgrid)
# Clean up the mess
gp.Delete(outgrid)