Add a function for projection of coordinate in arcgisscripting and arcpy

09-02-2010 06:35 AM
Status: Open
Labels (1)
New Contributor III

Add a function for projection on the fly for coordinates in a python script

The spatial reference optional argument on the cursors support this capability i.e. your feature class will be opened projected.  Another possibility is use of the OutputCoordinateSystem environment setting which will (in most cases) perform a projection as part of the tool operation.  Note that this is specifically for projection handling and not for datum transformation YMMV.
I am porting one of my Python apps from a pure open source GIS solution into an arcpy-based solution.  I use python dictionaries to track coordinates and attributes and to retrieve and manipulate them until all the data is read.  I must transform all the coordinates one-by-one to a common datum in order to make decisions like maximum X, etc.  My software is getting unbelievably complicated trying to work around arcpy's lack of a simple function to accomplish a single-point transformation.  I see other developers on the web having complained about this for many years.  I will resent having to bundle gdal/ogr/proj4 files or corpscon files into my solution.  It shouldn't be so complicated.