Geo Processing Tool to project WGS84 to UTM Zone11N

1027
1
Jump to solution
02-28-2013 04:54 PM
KenLucas
Occasional Contributor
I was wondering if someone could give me a python script that would simply change the lat & long coords, in the attached xlsx, from WGS84 to UTMZone11, meters. I'd like to, then, attempt, to create a geo processing tool to automate the script. The output should be two feature classes in a file geodbase, one the unprojected and the other the projected.  I've insured that the range is properly set in the xlsx, as explained in a pdf by T. Wayne Whitley in the  previous "finding the centroid between two points" thread, to accomodate the two rows of a single set of coordinates.
Ken
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
T__WayneWhitley
Frequent Contributor
Here's your toolbox zip attached (10.0 ver) - it contains the toolbox with the contained script tool, along with the 'stuff' to make it work.  The script is basically all you need to go with the tool, but I sent a few other things.  The tool is set 'relative-path' meaning if you unzip to a common location so that the tool and script are 'side-by-side', the tool will be able to 'find' and execute the script.

I had to 'cheat' a little in setting up the transform parameter so that you'd have a convenient and familiar drop-down list.  I sent a companion PDF only showing some screen shots - the 1st one is what the script tool form would typically look like before launching the geoprocessing...I picked the transform param we already talked about; mind you, this doesn't mean it is the most appropriate one for you and your region.  I also included a screen shot of the successful execution dialog (I had it spit back out at you the parameters as you set them before run-time).

You don't really need the GCS fc since the Event layer tool makes a 'virtual layer' but that's what you said you wanted, so you have gdb copies of them both (a stage.gdb copy of my execution w/ the 2 fcs [geographic and projected] was also included in the zip).  It appears you sent coordinates to the edge of pavement of a roadway (or ROW), and it seems with the params used for the projection, there's about a 1.26 meter difference -- you can test further and read further what is to be expected (or what spatial reference adjustments may need to be made).

I included the valuable resource that I used below (thanks to Logan Pugh -- and according to Ghislain Prince, 10.1 may have a ListTransformations function that'll be useful in populating the list of available transform methods [I hard-coded them here]).  Logan Pugh provided the 'shortcut' suggestion to use the string param and Value Filter on the transform method part of the tool.  More importantly, the info you will likely need for projecting (which is still relevant for 10.1, by the way) is also listed.

http://forums.arcgis.com/threads/29209-Specify-Geographic-Transformation-as-user-input-in-python-scr...

HowTo:  Select the correct geographic (datum) transformation when projecting between datums
http://support.esri.com/en/knowledgebase/techarticles/detail/21327


Anyway, take it for a test drive...

Enjoy,
Wayne

View solution in original post

0 Kudos
1 Reply
T__WayneWhitley
Frequent Contributor
Here's your toolbox zip attached (10.0 ver) - it contains the toolbox with the contained script tool, along with the 'stuff' to make it work.  The script is basically all you need to go with the tool, but I sent a few other things.  The tool is set 'relative-path' meaning if you unzip to a common location so that the tool and script are 'side-by-side', the tool will be able to 'find' and execute the script.

I had to 'cheat' a little in setting up the transform parameter so that you'd have a convenient and familiar drop-down list.  I sent a companion PDF only showing some screen shots - the 1st one is what the script tool form would typically look like before launching the geoprocessing...I picked the transform param we already talked about; mind you, this doesn't mean it is the most appropriate one for you and your region.  I also included a screen shot of the successful execution dialog (I had it spit back out at you the parameters as you set them before run-time).

You don't really need the GCS fc since the Event layer tool makes a 'virtual layer' but that's what you said you wanted, so you have gdb copies of them both (a stage.gdb copy of my execution w/ the 2 fcs [geographic and projected] was also included in the zip).  It appears you sent coordinates to the edge of pavement of a roadway (or ROW), and it seems with the params used for the projection, there's about a 1.26 meter difference -- you can test further and read further what is to be expected (or what spatial reference adjustments may need to be made).

I included the valuable resource that I used below (thanks to Logan Pugh -- and according to Ghislain Prince, 10.1 may have a ListTransformations function that'll be useful in populating the list of available transform methods [I hard-coded them here]).  Logan Pugh provided the 'shortcut' suggestion to use the string param and Value Filter on the transform method part of the tool.  More importantly, the info you will likely need for projecting (which is still relevant for 10.1, by the way) is also listed.

http://forums.arcgis.com/threads/29209-Specify-Geographic-Transformation-as-user-input-in-python-scr...

HowTo:  Select the correct geographic (datum) transformation when projecting between datums
http://support.esri.com/en/knowledgebase/techarticles/detail/21327


Anyway, take it for a test drive...

Enjoy,
Wayne
0 Kudos