I am trying to tranform one coordinate system to another (wgs84 to utm). Found one example on the internet (adapted a little). It got an error when I try to run the program. Since I am new to GDAL, I cannot figure out how to correct this. Please see the following program. I also tried to add one more value to "res.ct.TransformPoint(lon, lat)", but it did not solve the problem. Any help or hint appreciated. I also attach the error to the end.
from osgeo import osr import math import pyproj def UTMZone(lon, lat): return int((lon + 180) / 6) + 1 if __name__ == '__main__': lat = 41.395304 lon = 73.310067 wgs84 = osr.SpatialReference() utm = osr.SpatialReference() wgs84.ImportFromProj4("+proj=latlong +datum=WGS84") utm.ImportFromProj4("+proj=utm +zone="+str(UTMZone(lon,lat))+" +datum=WGS84") ct = osr.CoordinateTransformation(wgs84,utm) res= ct.TransformPoint(lon, lat) print res Error Message: Traceback (most recent call last): File "C:\Python25\trans.py", line 28, in <module> res= ct.TransformPoint(lon, lat) File "C:\Python25\lib\site-packages\osgeo\osr.py", line 602, in TransformPoint return _osr.CoordinateTransformation_TransformPoint(*args) NotImplementedError: Wrong number of arguments for overloaded function 'CoordinateTransformation_TransformPoint'. Possible C/C++ prototypes are: TransformPoint(double [3]) TransformPoint(double [3],double,double,double)
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev