Vikas Bansal
Vikas Bansal

Reputation: 2910

NotImplementedError: Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'

while I upload an created image to create a .KML File through django I got an error and I am not able to solve the ERROR on my web page :

Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'.
  Possible C/C++ prototypes are:
    OSRCoordinateTransformationShadow::TransformPoint(double [3])
    OSRCoordinateTransformationShadow::TransformPoint(double [3],double,double,double)

and this error on the terminal :

Internal Server Error: /
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/vikuman/Downloads/portal/iiserupdated/DjangoWebProject1/app/views.py", line 136, in home
    image_data, name_id, thresh, scale, len_dang_arcs, interval_distance, filter_value, value)
  File "/home/vikuman/Downloads/portal/iiserupdated/DjangoWebProject1/functions/PythonApplication1.py", line 350, in main
    tiff_to_kml(name_id + "stream_points_tiff_coordinates.csv",name_id + "stream_points.kml",name_of_file,name_id,save_path)
  File "/home/vikuman/Downloads/portal/iiserupdated/DjangoWebProject1/functions/PythonApplication1.py", line 159, in tiff_to_kml
    latlong = transform.TransformPoint(float(j.replace("]","").replace("[","").split(",")[0]),float(j.replace("]","").replace("[","").split(",")[1]))
  File "/usr/lib/python3/dist-packages/osgeo/osr.py", line 927, in TransformPoint
    return _osr.CoordinateTransformation_TransformPoint(self, *args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'.
  Possible C/C++ prototypes are:
    OSRCoordinateTransformationShadow::TransformPoint(double [3])
    OSRCoordinateTransformationShadow::TransformPoint(double [3],double,double,double)

First I thought this problem as Gdal problem(as mentioned in https://lists.osgeo.org/pipermail/gdal-dev/2015-February/041051.html) but upgrading Gdal didn't helped me.

Please help me in sorting this problem.

Upvotes: 2

Views: 2381

Answers (2)

Yi Hong
Yi Hong

Reputation: 1

The same problem, update GDAL cannot work. Solved by removing the GDAL package from the lib and reinstall gdal with the latest whl file. Hopes it can help.

Upvotes: 0

cherez
cherez

Reputation: 11

Make sure you have set the GDAL_DATA environment variable (e.g. /usr/share/gdal).

Upvotes: 1

Related Questions