I have (lat,long) coordinate describing the position of a point in a .geotiff image.
I wish to find the equivalent pixel coordinates of the lat,long ones inside the image.
I succeded using gdaltransform from the command line with the following instruction :
gdaltransform -i -t_srs epsg:4326 /path/imagename.tiff
-17.4380493164062 14.6951949085676
But i would like to retrieve such type of equivalence from python code. I tried the following :
from osgeo import osr
source = osr.SpatialReference()
source.ImportFromUrl(path + TIFFFilename)
target = osr.SpatialReference()
target.ImportFromEPSG(4326)
transform = osr.CoordinateTransformation(target,source )
point_xy = np.array(transform.TransformPoint(-17.4380493164062,14.6951949085676))
But it returns this error :
NotImp