Project_Management transformation question

529
2
11-29-2012 02:09 PM
SuzanneMonette
New Contributor III
Hi Everyone,

I'm trying to project some data via a script but am having trouble sorting out how to put in the transformation that's needed. I should give the heads up that I'm not overly versed in python or scripting - yet! 🙂

So here's what I have so far (at least the parts that I think are relevant):

coord_sys = arcpy.SpatialReference(r"D:\SueMonette\Geodesy\EPSG_Prj\2961.prj")
transformation = "WGS_1984_(ITRF00)_To_NAD_1983 + NAD_1983_CSRS_to_WGS_1984_2"

# Set new output coordinate system
arcpy.Project_management(out_features, out_features_proj, coord_sys, transformation)


I got the required transformation from the project tool - after checking them out they look like what I need to do. My data is in GCS North American 1983 and I'm going to NAD 83 CSRS UTM 20N. I've tried using a semi colon instead of the plus but no luck there. I haven't been able to find anything other than "String" for how to put the transformation in. I'll keep looking for a solution but if anyone has readily available tips they'd be much appreciated!

Thanks!

Sue
Tags (2)
0 Kudos
2 Replies
markdenil
Occasional Contributor III
Generally speaking,
If you can get the project tool to do the job, then use the Model Builder cheat to give you the python syntax.
Set up a model in Model Builder with just the project tool, and enter the parameters that you know work.
You can even test it by running the model.
Now Export the model as a Python Script.
The script will give you the syntax with the inputs in place.
0 Kudos
SuzanneMonette
New Contributor III
Generally speaking,
If you can get the project tool to do the job, then use the Model Builder cheat to give you the python syntax.
Set up a model in Model Builder with just the project tool, and enter the parameters that you know work.
You can even test it by running the model.
Now Export the model as a Python Script.
The script will give you the syntax with the inputs in place.


Hi Mark,

That's a good tip and I did give it a go, only it gave me the full transformation definition and I was under the impression from the help file that I could use the designated "name" for it instead.

Another thing I discovered was that using a shapefile with a different extent resulted in a different set of transformation options. I had used my original file to come up with the initial dual transformation, but when I went to test it I used my analysis version which was clipped substantially and was surprised to see only one transformation option available - which was different. I could see how this could happen given transformations aren't applicable everywhere. In this case though, the original dual transformation was applicable to all of Canada whereas the one I'm using now is for offshore Atlantic. That being said, the stated accuracy is lower for the later than the former. I can only guess that it's selecting the offshore transformation because even though the stated accuracy is lower, it's the better option because it's region specific v.s. country wide?

For our purposes the offshore Atlantic version will work.

Sue
0 Kudos