<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: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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:remialcxesans;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.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-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">Yes, I only happened to have an answer ready to go because I looked into it myself after seeing the same!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">Playing around a bit more, it looks like all of the issues stem from an original error with creating crsGeo, deriving from Proj being unable to match EPSG prog_type
is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">>>> proj_type = 123456789<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">>>> crsGeo.ImportFromEPSG(proj_type)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">ERROR 1: PROJ: proj_create_from_database: crs not found<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">6<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">This then results in a null transform being created:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">>>> t = osgeo.osr.CoordinateTransformation(crs, crsGeo)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">ERROR 1: PROJ: proj_create: unrecognized format / unknown name<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">ERROR 1: Cannot instantiate target_crs<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">ERROR 6: Cannot find coordinate operations from `EPSG:27700' to `'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">>>> t<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><osgeo.osr.CoordinateTransformation; proxy of None ><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">And I then receive the same (slightly misleading) error about the call arguments being incorrect:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">>>> (lat, long, z) = t.TransformPoint(posX, posY)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">Traceback (most recent call last):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> File "<stdin>", line 1, in <module><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> File "…/lib64/python3.6/site-packages/osgeo/osr.py", line 1104, in TransformPoint<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> return _osr.CoordinateTransformation_TransformPoint(self, *args)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">NotImplementedError: Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> Possible C/C++ prototypes are:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> OSRCoordinateTransformationShadow::TransformPoint(double [3])<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> OSRCoordinateTransformationShadow::TransformPoint(double [4])<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> OSRCoordinateTransformationShadow::TransformPoint(double [3],double,double,double)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"> OSRCoordinateTransformationShadow::TransformPoint(double [4],double,double,double,double)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US">(I suspect the error might originate from SWIG being unable to match the call for a None/null object, rather than a CoordinateTransform?)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif;color:#ED7D31">Dr Daniel Evans<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif">Software Developer<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div dir="ltr" style="mso-line-height-rule:exactly;-webkit-text-size-adjust:100%;direction:ltr;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;"><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="left" style="padding:10px 0 0;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;color:#4A4A49;font-style:normal;font-weight:700;white-space:nowrap;"><tr style="font-size:14.67px;"><td align="left" style="padding:0;vertical-align:top;font-family:Arial;">e: <span style="font-family:remialcxesans;font-size:1px;color:#FFFFFF;line-height:1px;"></span></td><td align="left" style="padding:0 0 0 4px;vertical-align:top;color:#F6A124;font-family:Arial;font-weight:400;"><a href="mailto:Daniel.Evans@jbarisk.com" target="_blank" id="LPlnk689713" style="text-decoration:none;color:#F6A124;"><strong style="font-weight:400;">Daniel.Evans@jbarisk.com</strong></a></td></tr><tr style="font-size:14.67px;"><td align="left" style="padding:0;vertical-align:top;font-family:Arial;">t: </td><td align="left" style="padding:0 0 0 4px;vertical-align:top;color:#F6A124;font-family:Arial;font-weight:400;"><a href="tel:+44%20(0)1756%20799919" target="_blank" id="LPlnk689713" style="text-decoration:none;color:#F6A124;"><strong style="font-weight:400;">+44 (0)1756 799919</strong></a></td></tr><tr style="font-size:0;"><td align="left" style="padding:0;vertical-align:top;"></td><td align="left" style="padding:0 0 0 4px;vertical-align:top;"></td></tr></table></td></tr></table></td></tr><tr style="color:#000001;font-size:14.67px;font-style:normal;font-weight:400;white-space:nowrap;"><td align="left" style="vertical-align:top;font-family:Arial;"><a href="http://www.jbarisk.com/" target="_blank" id="LPlnk689713" title="Click to visit our website" style="text-decoration:none;color:#F6A124;"><strong style="font-weight:400;">www.jbarisk.com</strong></a></td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="left" style="padding:10px 0 0;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td rowspan="3" align="left" style="padding:0 0 5px;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;font-size:0;"><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:10px 0 15px;vertical-align:top;"><img src="cid:image371680.png@187C299E.78E3B924" height="52" border="0" alt="" style="height:52px;min-height:52px;max-height:52px;font-size:0;" /></td></tr></table></td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="left" style="padding:0 0 12px;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="height:30px;font-size:0;"><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:0 4px 5px 0;vertical-align:top;"><a href="https://www.facebook.com/TheFloodPeople" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="cid:image276524.png@BB178C1D.D796FA45" width="34" border="0" title="Facebook" alt="Facebook" style="width:34px;min-width:34px;max-width:34px;font-size:12px;" /></a></td></tr></table></td><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:0 4px 5px 0;vertical-align:top;"><a href="https://www.linkedin.com/company/jba-risk-management/" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="cid:image802589.png@C912E537.CC26BC03" width="34" border="0" title="LinkedIn" alt="LinkedIn" style="width:34px;min-width:34px;max-width:34px;font-size:12px;" /></a></td></tr></table></td><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:0 4px 5px 0;vertical-align:top;"><a href="https://twitter.com/JBARisk" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="cid:image542806.png@CF8366BB.F6EF2BDE" width="34" border="0" title="Twitter" alt="Twitter" style="width:34px;min-width:34px;max-width:34px;font-size:12px;" /></a></td></tr></table></td><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:0 4px 5px 0;vertical-align:top;"><a href="https://www.youtube.com/channel/UC0iatom2jYbW96voW0rlpCw" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="cid:image312808.png@52A852B8.38A08A9E" width="34" border="0" title="YouTube" alt="YouTube" style="width:34px;min-width:34px;max-width:34px;font-size:12px;" /></a></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td><td style="padding:0;"> </td></tr><tr style="font-size:0;"><td style="padding:0;"> </td></tr><tr style="font-size:0;"><td style="padding:0;"> </td></tr></table></td></tr></table></td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:0;"><td align="left" style="padding:7px 0 5px;border-top:solid 1px #4A4A49;border-right:none;border-bottom:none;border-left:none;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="white-space:normal;color:#444444;font-size:14.67px;font-family:Calibri,Arial,sans-serif;font-weight:400;font-style:normal;text-align:left;line-height:12px;"><tr style="font-size:9px;"><td style="font-family:Arial;"><span style="background-color:#FFFFFF;">All JBA Risk Management's email messages contain confidential information and are intended only for the individual(s) named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.</span><br /><span style="background-color:#FFFFFF;">Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system.</span> <br /><span style="background-color:#FFFFFF;">JBA Risk Management Limited is registered in England, company number 07732946, 1 Broughton Park, Old Lane North, Broughton, Skipton, North Yorkshire, BD23 3FD, England</span><span style="color:#000001;">.</span><br /></td></tr></table></td></tr></table></td></tr></table></div><div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Paul Harwood <runette@gmail.com>
<br>
<b>Sent:</b> 16 June 2021 10:17<br>
<b>To:</b> Daniel Evans <Daniel.Evans@jbarisk.com><br>
<b>Cc:</b> zerovirus123 <briansia93@gmail.com>; gdal-dev <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [gdal-dev] TypeError Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I admit - I was just working from the nerror message ...<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">F:\Sliding_Windows\GeoTiff.py, line 402: TypeError Wrong number or type of<br>
arguments for overloaded function 'CoordinateTransformation_TransformPoint'.<br>
Possible C/C++ prototypes are:<br>
OSRCoordinateTransformationShadow::TransformPoint(double [3])<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">suggests that it is looking for 3 coords<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, 16 Jun 2021 at 10:02, Daniel Evans <<a href="mailto:Daniel.Evans@jbarisk.com">Daniel.Evans@jbarisk.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i>However - I think you need three input coords on the transform point? </i><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i> </i><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The Swig bindings for Python [should/used to] provide a wrapper for TransformPoint(), of the form TransformPoint(x, y, z=0.0) in Python terms.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It’s one of the listed bindings on the Python API documentation:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">TransformPoint(CoordinateTransformation self, double x, double y, double z=0.0)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="https://gdal.org/python/osgeo.osr.CoordinateTransformation-class.html" target="_blank">https://gdal.org/python/osgeo.osr.CoordinateTransformation-class.html</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Looking at the autogenerated SWIG source code in the latest version of the repository, it looks like that particular wrapper still exists:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">SWIGINTERN void OSRCoordinateTransformationShadow_TransformPoint__SWIG_2(OSRCoordinateTransformationShadow *self,double argout[3],double x,double y,double z=0.0){<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> if (self == NULL)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> return;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> argout[0] = x;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> argout[1] = y;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> argout[2] = z;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> OCTTransform( self, 1, &argout[0], &argout[1], &argout[2] );<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> }<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/extensions/osr_wrap.cpp#L4422" target="_blank">https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/extensions/osr_wrap.cpp#L4422</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I’ll admit none of that particularly helps solve the issue beyond saying “I think it should work”, though!<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Arial",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-family:"Arial",sans-serif;color:#ED7D31">Dr Daniel Evans</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-family:"Arial",sans-serif">Software Developer</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Arial",sans-serif"> </span><o:p></o:p></p>
<div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:7.5pt 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif;color:#4A4A49">e: </span></b><b><span style="font-size:1.0pt;font-family:remialcxesans;color:white"></span></b><b><span style="font-family:"Arial",sans-serif;color:#4A4A49"><o:p></o:p></span></b></p>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 3.0pt">
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#F6A124"><a href="mailto:Daniel.Evans@jbarisk.com" target="_blank"><strong><span style="font-family:"Arial",sans-serif;color:#F6A124;font-weight:normal;text-decoration:none">Daniel.Evans@jbarisk.com</span></strong></a><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif;color:#4A4A49">t: <o:p></o:p></span></b></p>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 3.0pt">
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#F6A124"><a href="tel:+44%20(0)1756%20799919" target="_blank"><strong><span style="font-family:"Arial",sans-serif;color:#F6A124;font-weight:normal;text-decoration:none">+44 (0)1756 799919</span></strong></a><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm"></td>
<td valign="top" style="padding:0cm 0cm 0cm 3.0pt"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#000001"><a href="http://www.jbarisk.com/" target="_blank" title="Click to visit our website"><strong><span style="font-family:"Arial",sans-serif;color:#F6A124;font-weight:normal;text-decoration:none">www.jbarisk.com</span></strong></a><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:7.5pt 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td rowspan="3" valign="top" style="padding:0cm 0cm 3.75pt 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:7.5pt 0cm 11.25pt 0cm">
<p class="MsoNormal"><span style="font-size:1.0pt"><img border="0" width="149" height="52" style="width:1.552in;height:.5416in" id="Picture_x0020_1" src="cid:image001.png@01D7629B.5F790AA0"></span><span style="font-size:1.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 9.0pt 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 3.0pt 3.75pt 0cm">
<p class="MsoNormal"><a href="https://www.facebook.com/TheFloodPeople" target="_blank"><span style="font-size:1.0pt;text-decoration:none"><img border="0" width="34" height="34" style="width:.3541in;height:.3541in" id="Picture_x0020_2" src="cid:image003.png@01D7629A.362B1E00" alt="Facebook"></span></a><span style="font-size:1.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 3.0pt 3.75pt 0cm">
<p class="MsoNormal"><a href="https://www.linkedin.com/company/jba-risk-management/" target="_blank"><span style="font-size:1.0pt;text-decoration:none"><img border="0" width="34" height="34" style="width:.3541in;height:.3541in" id="Picture_x0020_3" src="cid:image004.png@01D7629A.362B1E00" alt="LinkedIn"></span></a><span style="font-size:1.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 3.0pt 3.75pt 0cm">
<p class="MsoNormal"><a href="https://twitter.com/JBARisk" target="_blank"><span style="font-size:1.0pt;text-decoration:none"><img border="0" width="34" height="34" style="width:.3541in;height:.3541in" id="Picture_x0020_4" src="cid:image005.png@01D7629A.362B1E00" alt="Twitter"></span></a><span style="font-size:1.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0cm 3.0pt 3.75pt 0cm">
<p class="MsoNormal"><a href="https://www.youtube.com/channel/UC0iatom2jYbW96voW0rlpCw" target="_blank"><span style="font-size:1.0pt;text-decoration:none"><img border="0" width="34" height="34" style="width:.3541in;height:.3541in" id="Picture_x0020_5" src="cid:image006.png@01D7629A.362B1E00" alt="YouTube"></span></a><span style="font-size:1.0pt"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:1.0pt"> <o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:1.0pt"> <o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:1.0pt"> <o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="border:none;border-top:solid #4A4A49 1.0pt;padding:5.25pt 0cm 3.75pt 0cm">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:9.0pt"><span style="font-size:7.0pt;font-family:"Arial",sans-serif;color:#444444;background:white">All JBA Risk Management's email messages contain confidential information and are intended only for the individual(s)
named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.</span><span style="font-size:7.0pt;font-family:"Arial",sans-serif;color:#444444"><br>
<span style="background:white">Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system.</span>
<br>
<span style="background:white">JBA Risk Management Limited is registered in England, company number 07732946, 1 Broughton Park, Old Lane North, Broughton, Skipton, North Yorkshire, BD23 3FD, England</span></span><span style="font-size:7.0pt;font-family:"Arial",sans-serif;color:#000001">.</span><span style="font-size:7.0pt;font-family:"Arial",sans-serif;color:#444444"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>>
<b>On Behalf Of </b>Paul Harwood<br>
<b>Sent:</b> 16 June 2021 09:52<br>
<b>To:</b> zerovirus123 <<a href="mailto:briansia93@gmail.com" target="_blank">briansia93@gmail.com</a>><br>
<b>Cc:</b> gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>><br>
<b>Subject:</b> Re: [gdal-dev] TypeError Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'.</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Some ideas for you:<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">- In the conda environment - it says that Fiona and GDAL come from the pipwin channel. I would try importing them from the conda-forge channel since I think that is more actively
maintained (and by the core teams). This should do the trick<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:12.0pt;font-family:Consolas;color:#333333;background:#EEEFF0">conda install -c conda-forge fiona</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
Also the same for pyproj<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:12.0pt;font-family:Consolas;color:#333333;background:#EEEFF0">conda install -c conda-forge pyproj</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Pyproj and OSR can work in the same app - I am doing that. You do have to be a bit careful about remembering that the SR objects are not interchangeable.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">- in the conda environment if it working correctly - you should NOT have to worry about proj - the correct version is and environment variables are loaded automatically as part
of the activate command. Indeed - having other versions of proj.dll in the PATH will just confuse things - try removing them and any env variables set OUTSIDE of the conda activate command.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I think that all of those errors are caused by this error:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">C:\Users\Deployment\.conda\envs\sw_py37_cv45\Library\share\proj\proj.db<br>
lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR<br>
metadata. It comes from another PROJ installation<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">However - I think you need three input coords on the transform point? <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">That command says that it is getting proj from an environment called sw_py_cv45. Just to ask the obvious question ... That is the environment that you 3expect to be using ..correct?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The error does suggest that the environment is corrupted and the version of proj.dll in the env (or being found by the Python installed in the env) is not the same as the version
of the proj.db in the share directory of the env. If it was me - I would probably start again from scratch - i.e.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">conda create --name test<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">conda activate test<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">conda install -c conda-forge fiona <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">conda install -c conda-forge pyproj <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">and see what you get.<br>
<br>
Just as a BTW - it looks like you have a custom config of Anaconda - since conda usually puts the env directory in a directory called `anaconda3`. Are you sure that the conda config is correct?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Wed, 16 Jun 2021 at 05:42, zerovirus123 <<a href="mailto:briansia93@gmail.com" target="_blank">briansia93@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am trying to run some GDAL operations inside my Anaconda environment.<br>
However once I upgraded my gdal and other packages the program crashed.<br>
<br>
Environment: Anaconda<br>
<br>
Package Version Channel<br>
GDAL 3.3.0 pipwin<br>
fiona 1.8.20 pipwin<br>
geopandas 0.9.0 pipwin<br>
shapely 1.7.1 pipwin<br>
pyproj 2.6.1.post1 py37hcfa1391_1<br>
<br>
Here is the offending code.<br>
<br>
crsGeo = osgeo.osr.SpatialReference()<br>
crsGeo.ImportFromEPSG(int(proj_type))<br>
t = osgeo.osr.CoordinateTransformation(crs, crsGeo)<br>
(lat, long, z) = t.TransformPoint(posX, posY)<-------------------<br>
srs = osgeo.osr.SpatialReference(wkt=prj) <br>
<br>
And the raster's metadata.<br>
/proj: GEOGCS["WGS 84",<br>
DATUM["WGS_1984",<br>
SPHEROID["WGS 84",6378137,298.257223563,<br>
AUTHORITY["EPSG","7030"]],<br>
AUTHORITY["EPSG","6326"]],<br>
PRIMEM["Greenwich",0],<br>
UNIT["degree",0.0174532925199433,<br>
AUTHORITY["EPSG","9122"]],<br>
AXIS["Latitude",NORTH],<br>
AXIS["Longitude",EAST],<br>
AUTHORITY["EPSG","4326"]]<br>
proj type: 4326/<br>
<br>
The code threw the following error.<br>
<br>
*ERROR 1: PROJ: proj_create_from_database:<br>
C:\Users\Deployment\.conda\envs\sw_py37_cv45\Library\share\proj\proj.db<br>
lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR<br>
metadata. It comes from another PROJ installation.<br>
ERROR 1: PROJ: proj_create_from_database:<br>
C:\Users\Deployment\.conda\envs\sw_py37_cv45\Library\share\proj\proj.db<br>
lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR<br>
metadata. It comes from another PROJ installation.<br>
ERROR 1: PROJ: proj_create: unrecognized format / unknown name<br>
ERROR 6: Cannot find coordinate operations from `GEOGCRS["WGS<br>
84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS<br>
84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["latitude",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["longitude",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]]'<br>
to `'<br>
Could not calculate crsGeo spatial reference.<br>
F:\Sliding_Windows\GeoTiff.py, line 402: TypeError Wrong number or type of<br>
arguments for overloaded function 'CoordinateTransformation_TransformPoint'.<br>
Possible C/C++ prototypes are:<br>
OSRCoordinateTransformationShadow::TransformPoint(double [3])<br>
OSRCoordinateTransformationShadow::TransformPoint(double [4])<br>
OSRCoordinateTransformationShadow::TransformPoint(double<br>
[3],double,double,double)<br>
OSRCoordinateTransformationShadow::TransformPoint(double<br>
[4],double,double,double,double)*<br>
<br>
Based on previous posts, it seems that proj.dll is missing from some PATH<br>
variable. My environment only has a proj_6_2.dll, and even with that added<br>
to my system's PATH, the error persists.<br>
<br>
I have tried to put posX and posY inside tuples/list as well, but that did<br>
not help.<br>
<br>
Is this a package mismatch issue? Missing dependencies issue? Or was there a<br>
change in how TransformPoint should be called?<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html" target="_blank">
http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>