[gdal-dev] Proper input for TransformPoint

Mano Marks mmarks at google.com
Fri Oct 23 17:56:29 EDT 2009


Thanks, that helped. Actually, it turned out the problem was that the
SR I was using wasn't being recognized. I'm not sure why this caused
the particular error that it did.

Mano Marks
Geo Developer Advocate
http://twitter.com/ManoMarks




On Fri, Oct 23, 2009 at 2:20 PM, Jamie Adams <jaadfoo at gmail.com> wrote:
> I have it working for KML output like this:
>
> projection = dataset.GetProjection()
>
> in_projection = osr.SpatialReference()
> in_projection.ImportFromWkt(projection)
>
> out_projection = osr.SpatialReference()
> out_projection.ImportFromEPSG(4326)
>
> coortran = osr.CoordinateTransformation(in_projection, out_projection)
>
> (x_out, y_out, z_out) = coortran.TransformPoint(x_coor, y_coor)
>
> Even though there is no z input in the transform, it will bail with
> "ValueError: too many values to unpack" if you don't include it.
>
> - Jamie
>
> On Fri, Oct 23, 2009 at 1:57 PM, Mano Marks <mmarks at google.com> wrote:
>>
>> Developing in Python, I've tried a number of inputs for
>> TransformPoint, and can't seem to figure out how to get this right.
>> And web searches reveal several people asking similar questions
>> without an answer. Anyone?
>>
>> Here's the error I get:
>>
>> NotImplementedError: Wrong number of arguments for overloaded function
>> 'Coordina
>> teTransformation_TransformPoint'.
>>  Possible C/C++ prototypes are:
>>    TransformPoint(double [3])
>>    TransformPoint(double [3],double,double,double)
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>


More information about the gdal-dev mailing list