[gdal-dev] How to use TransformPoints in python?

Frank Warmerdam warmerdam at pobox.com
Fri Jan 16 09:07:37 EST 2009


Hogendoorn, Rene wrote:
>     x = numpy.array( [p[0] for p in polygon] )
>     y = numpy.array( [p[1] for p in polygon] )
>     z = numpy.array( [p[2] for p in polygon] )
> 
>     print proj.TransformPoints( len(polygon), x, y, z)
> 
> returns:
> 
> Traceback (most recent call last):
>   File "<stdin>", line 37, in <module>
>   File 
> "/var/tmp/libgdal0-1.6.0-build/usr/lib64/python2.6/site-packages/osgeo/osr.py", 
> line 622, in TransformPoints
>    
> TypeError: in method 'CoordinateTransformation_TransformPoints', 
> argument 3 of type 'double *'
> 
> I also tried straight python lists of doubles.
> So what type of arguments does TransformPoints expect (as there is 
> obviously nothing like double* in python)?

Rene,

To the best of my knowledge TransformPoints() is not currently working smoothly
with Python.  I have just been using TransformPoint().  You might want to file
a ticket on this.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list