[gdal-dev] Possible bug in gdal.TransformPoint() gdal 3.0.1

Deschamps, Benjamin (EC) benjamin.deschamps at canada.ca
Tue Jan 7 13:41:35 PST 2020

Hi gdal-dev list,

Not sure if this is a bug so posting here first...

I am having to reverse X and Y coordinates in a coordinate transformations (in at least 3 different dst_crs) otherwise I am getting -inf values. Python bindings with GDAL 3.0.1, Python 3.7.2 64-bit on Windows 10.

For a point near the dateline in the Arctic at (175W, 80N):

from osgeo import osr
in_crs = osr.SpatialReference()
out_crs = osr.SpatialReference()
transformation = osr.CoordinateTransformation(in_crs, out_crs)
print(transformation.TransformPoint(-175, 80, 0)) # lon, lat
print(transformation.TransformPoint(80, -175, 0))  # lat, lon

Gives :

(inf, inf, inf)
(4983944.437216174, 5754720.297247784, 0.0) # correct



Benjamin Deschamps
Environment and Climate Change Canada / Government of Canada
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200107/2e217bf2/attachment.html>

More information about the gdal-dev mailing list