fix for release 6.6 gdal 2.5 compatiblity
Closes #1891 (closed)
This will create a new commit in order to revert the existing changes.