<div dir="ltr">I admit - I was just working from the nerror message ...<div><br></div><div><span style="">F:\Sliding_Windows\GeoTiff.py, line 402: TypeError Wrong number or type of</span><br style="overflow-wrap: break-word;"><span style="">arguments for overloaded function 'CoordinateTransformation_Tran</span><span style="">sformPoint'.</span><br style="overflow-wrap: break-word;"><span style="">  Possible C/C++ prototypes are:</span><br style="overflow-wrap: break-word;"><span style="">    OSRCoordinateTransformationSha</span><span style="">dow::TransformPoint(double [3])</span><br></div><div><span style=""><br></span></div><div><span style="">suggests that it is looking for 3 coords</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 16 Jun 2021 at 10:02, Daniel Evans <<a href="mailto:Daniel.Evans@jbarisk.com">Daniel.Evans@jbarisk.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-GB" style="overflow-wrap: break-word;">
<div class="gmail-m_-4649584270649053330WordSection1">
<p class="MsoNormal"><i>However - I think you need three input coords on the transform point? <u></u><u></u></i></p>
<p class="MsoNormal"><i><u></u> <u></u></i></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It’s one of the listed bindings on the Python API documentation:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">TransformPoint(CoordinateTransformation self, double x, double y, double z=0.0)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><a href="https://gdal.org/python/osgeo.osr.CoordinateTransformation-class.html" target="_blank">https://gdal.org/python/osgeo.osr.CoordinateTransformation-class.html</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Looking at the autogenerated SWIG source code in the latest version of the repository, it looks like that particular wrapper still exists:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">SWIGINTERN void OSRCoordinateTransformationShadow_TransformPoint__SWIG_2(OSRCoordinateTransformationShadow *self,double argout[3],double x,double y,double z=0.0){<u></u><u></u></p>
<p class="MsoNormal">    if (self == NULL)<u></u><u></u></p>
<p class="MsoNormal">        return;<u></u><u></u></p>
<p class="MsoNormal">    argout[0] = x;<u></u><u></u></p>
<p class="MsoNormal">    argout[1] = y;<u></u><u></u></p>
<p class="MsoNormal">    argout[2] = z;<u></u><u></u></p>
<p class="MsoNormal">    OCTTransform( self, 1, &argout[0], &argout[1], &argout[2] );<u></u><u></u></p>
<p class="MsoNormal">  }<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><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><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’ll admit none of that particularly helps solve the issue beyond saying “I think it should work”, though!<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-family:Arial,sans-serif;color:rgb(237,125,49)">Dr Daniel Evans<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-family:Arial,sans-serif">Software Developer<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-family:Arial,sans-serif"><u></u> <u></u></span></p>
<div dir="ltr" style="direction:ltr"><table cellpadding="0" cellspacing="0" border="0" style="width:100%"><tbody><tr style="font-size:0px"><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px"><tbody><tr style="font-size:0px"><td align="left" style="padding:10px 0px 0px;vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px;color:rgb(74,74,73);font-style:normal;font-weight:700;white-space:nowrap"><tbody><tr style="font-size:14.67px"><td align="left" style="padding:0px;vertical-align:top;font-family:Arial">e: <span style="font-family:remialcxesans;font-size:1px;color:rgb(255,255,255);line-height:1px">​</span></td><td align="left" style="padding:0px 0px 0px 4px;vertical-align:top;color:rgb(246,161,36);font-family:Arial;font-weight:400"><a href="mailto:Daniel.Evans@jbarisk.com" id="gmail-m_-4649584270649053330LPlnk689713" style="text-decoration:none;color:rgb(246,161,36)" target="_blank"><strong style="font-weight:400">Daniel.Evans@jbarisk.com</strong></a></td></tr><tr style="font-size:14.67px"><td align="left" style="padding:0px;vertical-align:top;font-family:Arial">t: </td><td align="left" style="padding:0px 0px 0px 4px;vertical-align:top;color:rgb(246,161,36);font-family:Arial;font-weight:400"><a href="tel:+44%20(0)1756%20799919" id="gmail-m_-4649584270649053330LPlnk689713" style="text-decoration:none;color:rgb(246,161,36)" target="_blank"><strong style="font-weight:400">+44 (0)1756 799919</strong></a></td></tr><tr style="font-size:0px"><td align="left" style="padding:0px;vertical-align:top"></td><td align="left" style="padding:0px 0px 0px 4px;vertical-align:top"></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr style="color:rgb(0,0,1);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/" id="gmail-m_-4649584270649053330LPlnk689713" title="Click to visit our website" style="text-decoration:none;color:rgb(246,161,36)" target="_blank"><strong style="font-weight:400">www.jbarisk.com</strong></a></td></tr><tr style="font-size:0px"><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px"><tbody><tr style="font-size:0px"><td align="left" style="padding:10px 0px 0px;vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px"><tbody><tr style="font-size:0px"><td rowspan="3" align="left" style="padding:0px 0px 5px;vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;font-size:0px"><tbody><tr style="font-size:0px"><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px;line-height:normal"><tbody><tr style="font-size:0px"><td align="left" style="padding:10px 0px 15px;vertical-align:top"><img src="cid:17a141afebd60413e521" height="52" border="0" alt="" style="height: 52px; min-height: 52px; max-height: 52px; font-size: 0px;"></td></tr></tbody></table></td></tr><tr style="font-size:0px"><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px"><tbody><tr style="font-size:0px"><td align="left" style="padding:0px 0px 12px;vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="height:30px;font-size:0px"><tbody><tr style="font-size:0px"><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px;line-height:normal"><tbody><tr style="font-size:0px"><td align="left" style="padding:0px 4px 5px 0px;vertical-align:top"><a href="https://www.facebook.com/TheFloodPeople" id="gmail-m_-4649584270649053330LPlnk689713" style="text-decoration:none" target="_blank"><img src="cid:17a141afebd40795e8a2" width="34" border="0" title="Facebook" alt="Facebook" style="width: 34px; min-width: 34px; max-width: 34px; font-size: 12px;"></a></td></tr></tbody></table></td><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px;line-height:normal"><tbody><tr style="font-size:0px"><td align="left" style="padding:0px 4px 5px 0px;vertical-align:top"><a href="https://www.linkedin.com/company/jba-risk-management/" id="gmail-m_-4649584270649053330LPlnk689713" style="text-decoration:none" target="_blank"><img src="cid:17a141afebeafb03edc3" width="34" border="0" title="LinkedIn" alt="LinkedIn" style="width: 34px; min-width: 34px; max-width: 34px; font-size: 12px;"></a></td></tr></tbody></table></td><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px;line-height:normal"><tbody><tr style="font-size:0px"><td align="left" style="padding:0px 4px 5px 0px;vertical-align:top"><a href="https://twitter.com/JBARisk" id="gmail-m_-4649584270649053330LPlnk689713" style="text-decoration:none" target="_blank"><img src="cid:17a141afebe3d87ead54" width="34" border="0" title="Twitter" alt="Twitter" style="width: 34px; min-width: 34px; max-width: 34px; font-size: 12px;"></a></td></tr></tbody></table></td><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px;line-height:normal"><tbody><tr style="font-size:0px"><td align="left" style="padding:0px 4px 5px 0px;vertical-align:top"><a href="https://www.youtube.com/channel/UC0iatom2jYbW96voW0rlpCw" id="gmail-m_-4649584270649053330LPlnk689713" style="text-decoration:none" target="_blank"><img src="cid:17a141afebe17c9c9bf5" width="34" border="0" title="YouTube" alt="YouTube" style="width: 34px; min-width: 34px; max-width: 34px; font-size: 12px;"></a></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td><td style="padding:0px"> </td></tr><tr style="font-size:0px"><td style="padding:0px"> </td></tr><tr style="font-size:0px"><td style="padding:0px"> </td></tr></tbody></table></td></tr></tbody></table></td></tr><tr style="font-size:0px"><td align="left" style="vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0px"><tbody><tr style="font-size:0px"><td align="left" style="padding:7px 0px 5px;border-top:1px solid rgb(74,74,73);border-right:none;border-bottom:none;border-left:none;vertical-align:top"><table cellpadding="0" cellspacing="0" border="0" style="white-space:normal;color:rgb(68,68,68);font-size:14.67px;font-family:Calibri,Arial,sans-serif;font-weight:400;font-style:normal;text-align:left;line-height:12px"><tbody><tr style="font-size:9px"><td style="font-family:Arial"><span style="background-color:rgb(255,255,255)">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:rgb(255,255,255)">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:rgb(255,255,255)">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:rgb(0,0,1)">.</span><br></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><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'.<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Some ideas for you:<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">- 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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Consolas;color:rgb(51,51,51);background:rgb(238,239,240)">conda install -c conda-forge fiona</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
Also the same for pyproj<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:Consolas;color:rgb(51,51,51);background:rgb(238,239,240)">conda install -c conda-forge pyproj</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">- 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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I think that all of those errors are caused by this error:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">However - I think you need three input coords on the transform point? <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">conda create --name test<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">conda activate test<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">conda install -c conda-forge fiona <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">conda install -c conda-forge pyproj <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, 16 Jun 2021 at 05:42, zerovirus123 <<a href="mailto:briansia93@gmail.com" target="_blank">briansia93@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">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><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>

</blockquote></div>