gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Python docs: GCPsToGeoTransform signature incorrect

Open vilhelmen opened this issue 1 year ago • 1 comments

What is the bug?

Docs say osgeo.gdal.GCPsToGeoTransform(int nGCPs, int bApproxOK=1)→ RETURN_NONE, which is wrong since it accepts a list of GCPs and the approximation flag and returns the transform. I'm unable to determine the correct name for bApproxOK, it doesn't seem to be bApproxOK or ApproxOK, or approxOK and I'm not good enough at reading SWIG to locate or fix it. Seems to work fine without being named e.g gdal.GCPsToGeoTransform(ds.GetGCPs(), True)

Since these are C/C++, it should be something like osgeo.gdal.GCPsToGeoTransform(GCP *GPCs, bool ???=True)→ double [6] or maybe double * for the return value?

Steps to reproduce the issue

from osgeo import gdal
print(gdal.GCPsToGeoTransform.__doc__)

Versions and provenance

MacOS 15.1, GDAL 3.10.0, released 2024/11/01 via Homebrew

Additional context

No response

vilhelmen avatar Nov 13 '24 02:11 vilhelmen

I'm unable to determine the correct name for bApproxOK

There's none. It is a positional optional argument, not a named one. Cf usages in https://github.com/OSGeo/gdal/blob/master/autotest/gcore/gcps2geotransform.py

rouault avatar Nov 13 '24 11:11 rouault