I am trying to project a dataset in GCS_WGS_1984 to Sphere_Cylindrical_Equal_Area using arcpy.Project_management and am getting the following error:
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
Here is my code block:
arcpy.Project_magagement(CIM_TDC, CIM_eqArea, r"PROJCS['Sphere_Cylindrical_Equal_Area'," +\
r"GEOGCS['GCS_Sphere'," + \
r"DATUM['D_Sphere'," + \
r"SPHEROID['Sphere',6371000.0,0.0]]," + \
r"PRIMEM['Greenwich',0.0]," + \
r"UNIT['Degree',0.0174532925199433]]," + \
r"PROJECTION['Cylindrical_Equal_Area']," + \
r"PARAMETER['False_Easting',0.0]," + \
r"PARAMETER['False_Northing',0.0]," + \
"rPARAMETER['Central_Meridian',0.0]," + \
r"PARAMETER['Standard_Parallel_1',0.0]," + \
r"UNIT['Meter',1.0]]")
I think I need to define a geographic transformation but am not sure which one. Any help is greatly appreciated.
Solved! Go to Solution.
I was able to solve this using this solution:Undefined geographic transformation ProjectRaster_management. Create CustomGeoTransformation in ArcMap.
Hi Matthew,
Execute the Project tool in ArcMap first. The tool will automatically populate the transformation for you. After the tool is executed, open your Results window (Window > Results). Right-click on the tool > Copy as Python Snippet. You can then paste this into your script.
I tried this (I got my Python code from ArcMap originally). But now I am getting an ArcMap pop-up window saying: Undefined geographic transformation. When I try to do the projection.
try spelling management correctly ....arcpy.Project_magagement??
It's spelled correctly in my script. For some reason this editor is not friendly to copy/paste from Python, so I typed it in manually in my question.
I wouldn't trust the rest either, if the SR exists from a different file, try using it instead. See the SR help topic for options...for example
SR = sr = arcpy.SpatialReference(12345) #where 12345 is the code
I was able to solve this using this solution:Undefined geographic transformation ProjectRaster_management. Create CustomGeoTransformation in ArcMap.