Arcpy to convert a dataset in GCS_WGS_1984 to Sphere_Cylindrical_Equal_Area

2869
6
Jump to solution
11-04-2014 12:09 PM
MathewStrassburg
New Contributor II

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.

0 Kudos
1 Solution

Accepted Solutions
MathewStrassburg
New Contributor II

I was able to solve this using this solution:Undefined geographic transformation ProjectRaster_management.  Create CustomGeoTransformation in ArcMap.

View solution in original post

0 Kudos
6 Replies
JakeSkinner
Esri Esteemed Contributor

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.

0 Kudos
MathewStrassburg
New Contributor II

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.

0 Kudos
DanPatterson_Retired
MVP Emeritus

try spelling management correctly ....arcpy.Project_magagement??

0 Kudos
MathewStrassburg
New Contributor II

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.

0 Kudos
DanPatterson_Retired
MVP Emeritus

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

0 Kudos
MathewStrassburg
New Contributor II

I was able to solve this using this solution:Undefined geographic transformation ProjectRaster_management.  Create CustomGeoTransformation in ArcMap.

0 Kudos