<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi gdal-dev list,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Not sure if this is a bug so posting here first…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For a point near the dateline in the Arctic at (175W, 80N):<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">from osgeo import osr<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">in_crs = osr.SpatialReference()<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">in_crs.ImportFromEPSG(4326)<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">out_crs = osr.SpatialReference()<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span lang="FR-CA">out_crs.ImportFromEPSG(3347)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span lang="FR-CA">transformation = osr.CoordinateTransformation(in_crs, out_crs)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span lang="FR-CA">print(transformation.TransformPoint(-175, 80, 0)) # lon, lat<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span lang="FR-CA">print(transformation.TransformPoint(80, -175, 0)) # lat, lon<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA">Gives :<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span lang="FR-CA">(inf, inf, inf)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span lang="FR-CA">(4983944.437216174, 5754720.297247784, 0.0) # correct<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><a href="https://epsg.io/transform#s_srs=4326&t_srs=3347&x=-175.0000000&y=80.0000000"><span lang="FR-CA">https://epsg.io/transform#s_srs=4326&t_srs=3347&x=-175.0000000&y=80.0000000</span></a><o:p></o:p></p>
<p class="MsoNormal"><span lang="FR-CA"><o:p> </o:p></span></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-CA">Benjamin Deschamps</span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:EN-CA"><br>
</span><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:EN-CA">Environment and Climate Change Canada / Government of Canada<o:p></o:p></span></p>
</div>
</body>
</html>