gdal_contour generates contours which are not right-side-high
To see the problem, generate contours from the attached testdem.tif with an interval of 12.192. Several contours near the central high point are oriented counter clockwise.
The logic for determining left-side-high in GDALContourGenerator::ProcessRect is wrong. Patch attached which correctly determines the high side, avoids the need to reverse vectors by giving them the correct orientation to start with, and removes return codes from several functions which either never return a failure code or for which the return code is always ignored.
Chaitanya,
Please review and apply as appropriate.