[gdal-dev] TypeError Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'.

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Wed Jun 16 07:45:38 PDT 2021


Hi,

At least you must fix this error first
"ERROR 1: PROJ: proj_create_from_database:
C:\Users\Deployment\.conda\envs\sw_py37_cv45\Library\share\proj\proj.db
lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR
metadata. It comes from another PROJ installation."

Your proj.db database must come from some older version than your current
Proj. Proj is reading the table "metadata" and the CREATE TABLE SQL for that
it currently https://github.com/OSGeo/PROJ/blob/master/data/sql/metadata.sql
and contains 

INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MAJOR', 1);
INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MINOR', 1);

Those fields were added 2020-11-30 by commit
https://github.com/OSGeo/PROJ/commit/eef73e3eca2959768563d2dbb95a591c68b1d807#diff-7efcaee17a3e41e5440dc2ff9e962f20ad448a3ce5d7fff45a839846a85f37f8


-Jukka Rahkonen-






zerovirus123 wrote
> I am trying to run some GDAL operations inside my Anaconda environment.
> However once I upgraded my gdal and other packages the program crashed.
> 
> Environment: Anaconda
> 
> Package               Version                  Channel
> GDAL                   3.3.0                      pipwin
> fiona                     1.8.20                    pipwin
> geopandas           0.9.0                      pipwin
> shapely                1.7.1                      pipwin
> pyproj                   2.6.1.post1            py37hcfa1391_1
> 
> Here is the offending code.
> 
> crsGeo = osgeo.osr.SpatialReference()
> crsGeo.ImportFromEPSG(int(proj_type))
> t = osgeo.osr.CoordinateTransformation(crs, crsGeo)
> (lat, long, z) = t.TransformPoint(posX, posY)<-------------------
> srs = osgeo.osr.SpatialReference(wkt=prj)  
> 
> And the raster's metadata.
> /proj:  GEOGCS["WGS 84",
>     DATUM["WGS_1984",
>         SPHEROID["WGS 84",6378137,298.257223563,
>             AUTHORITY["EPSG","7030"]],
>         AUTHORITY["EPSG","6326"]],
>     PRIMEM["Greenwich",0],
>     UNIT["degree",0.0174532925199433,
>         AUTHORITY["EPSG","9122"]],
>     AXIS["Latitude",NORTH],
>     AXIS["Longitude",EAST],
>     AUTHORITY["EPSG","4326"]]
> proj type:  4326/
> 
> The code threw the following error.
> 
> *ERROR 1: PROJ: proj_create_from_database:
> C:\Users\Deployment\.conda\envs\sw_py37_cv45\Library\share\proj\proj.db
> lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR
> metadata. It comes from another PROJ installation.
> ERROR 1: PROJ: proj_create_from_database:
> C:\Users\Deployment\.conda\envs\sw_py37_cv45\Library\share\proj\proj.db
> lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR
> metadata. It comes from another PROJ installation.
> ERROR 1: PROJ: proj_create: unrecognized format / unknown name
> ERROR 6: Cannot find coordinate operations from `GEOGCRS["WGS
> 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS
> 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]]'
> to `'
> Could not calculate crsGeo spatial reference.
> F:\Sliding_Windows\GeoTiff.py, line 402: TypeError Wrong number or type of
> arguments for overloaded function
> 'CoordinateTransformation_TransformPoint'.
>   Possible C/C++ prototypes are:
>     OSRCoordinateTransformationShadow::TransformPoint(double [3])
>     OSRCoordinateTransformationShadow::TransformPoint(double [4])
>     OSRCoordinateTransformationShadow::TransformPoint(double
> [3],double,double,double)
>     OSRCoordinateTransformationShadow::TransformPoint(double
> [4],double,double,double,double)*
> 
> Based on previous posts, it seems that proj.dll is missing from some PATH
> variable. My environment only has a proj_6_2.dll, and even with that added
> to my system's PATH, the error persists.
> 
> I have tried to put posX and posY inside tuples/list as well, but that did
> not help.
> 
> Is this a package mismatch issue? Missing dependencies issue? Or was there
> a
> change in how TransformPoint should be called?
> 
> 
>         
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list