Undefined geographic transformation ProjectRaster_management

4596
5
04-05-2012 06:09 PM
JohnMorgan
Regular Contributor
Hello,
I am trying to automate the re-projection of some raster data. The projection information is stored in a .prj file.  However, I keep getting the following error:

<class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
Undefined geographic transformation.
Failed to execute (ProjectRaster).


Here is my relevant python code:

prjFile = r"C:\\Data\\NEMAC\\Projects\\NCA\\Scripting\\ArcPyGDAL\\proj_files\\MM5i.prj"
arcpy.DefineProjection_management(inPrjFile, prjFile)
arcpy.ProjectRaster_management(inRaster, "projected\\"+outRaster, "PROJCS['WGS_1984_Web_Mercator',GEOGCS['GCS_WGS_1984_Major_Auxiliary_Sphere',DATUM['D_WGS_1984_Major_Auxiliary_Sphere',SPHEROID['WGS_1984_Major_Auxiliary_Sphere',6378137.0,0.0]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],UNIT['Meter',1.0]]", "NEAREST", "50000", "NAD_1983_To_WGS_1984_1", "", "PROJCS['MM5i',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['Lambert_Conformal_Conic'],PARAMETER['False_Easting',3825000.0],PARAMETER['False_Northing',3200000.0],PARAMETER['Central_Meridian',-97.0],PARAMETER['Standard_Parallel_1',30.0],PARAMETER['Standard_Parallel_2',60.0],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',47.5],UNIT['Meter',1.0]]")


Any suggestions or help would be greatly appreciated.

Sincerely,
Derek
Tags (2)
0 Kudos
5 Replies
markdenil
Frequent Contributor
You are projecting from a system based on a sphere (SPHEROID['WGS_1984_Major_Auxiliary_Sphere',6378137.0,0.0])
to one based on a spheroid (SPHEROID['GRS_1980',6378137.0,298.257222101])

You will need to define a custom transformation for this using the CreateCustomGeoTransformation_management tool.
For the Method choose 'Geocentric_Translation'
and for the parameters, use zeros

Include this transformation in your projection tool parameters.
0 Kudos
JohnMorgan
Regular Contributor
Thank so much for you response.  I am still struggling w/ this a bit.  I am now getting the following error:
ERROR 999999: Error executing function.
Failed to copy raster dataset

Here is my python code as it is now

    Output_Geographic_Coordinate_System = "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
    #arcpy.CreateCustomGeoTransformation_management("MM5iGeoTrans", "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]]", Output_Geographic_Coordinate_System, "GEOGTRAN[METHOD['Geocentric_Translation'],PARAMETER['X_Axis_Translation',0.0],PARAMETER['Y_Axis_Translation',0.0],PARAMETER['Z_Axis_Translation',0.0]]")
    for mid in modelsMM5I:       
        inRaster = ""+mid['fileName']+"_result1.tif"
        arcpy.AddMessage("inRaster: " + inRaster)
        outRaster = ""+mid['fileName']+"_result1WGS84.tif"
        inPrjFile = inRaster
        prjFile = r"C:\\Data\\NEMAC\\Projects\\NCA\\Scripting\\ArcPyGDAL\\proj_files\\MM5i.prj"
        arcpy.DefineProjection_management(inPrjFile, prjFile)
        arcpy.ProjectRaster_management(inRaster, "projected\\"+outRaster, Output_Geographic_Coordinate_System, "NEAREST", "50000", "MM5iGeoTrans", "", "PROJCS['WGS_1984_World_Mercator',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],UNIT['Meter',1.0]]")


Thanks again for your assistance.
Derek
0 Kudos
markdenil
Frequent Contributor
How, exactly, is
""+mid['fileName']+"_result1.tif"
supposed to resolve?
At first glance, it seems a rather unlikely file name...
0 Kudos
JohnMorgan
Regular Contributor
It is actually a variable name within a python script.  Sorry for not clarifying that.
0 Kudos
markdenil
Frequent Contributor
Oh, it is a dictionary key in the mid dictionary.
If the file name is resolving correctly, then there must be some local problem preventing the raster copy.
0 Kudos