1111 * SPDX-License-Identifier: MIT
1212 ****************************************************************************/
1313
14+ // ABELL
15+ #include < iostream>
16+
1417#include < algorithm>
1518#include < atomic>
1619#include < cassert>
@@ -295,7 +298,6 @@ bool ViewshedExecutor::readLine(int nLine, Lines &lines)
295298
296299 if (sdMode ())
297300 {
298- lines.input = lines.cur ;
299301 double nodata = m_sdBand.GetNoDataValue ();
300302 int sdStatus = m_sdBand.RasterIO (
301303 GF_Read, oOutExtent.xStart , nLine, oOutExtent.xSize (), 1 ,
@@ -497,6 +499,9 @@ bool ViewshedExecutor::processFirstLine(Lines &lines)
497499 m_dfZObserver += lines.cur [m_nX];
498500
499501 LineLimits ll = adjustHeight (nYOffset, lines);
502+ if (sdMode ())
503+ lines.input = lines.cur ;
504+
500505 if (oCurExtent.containsX (m_nX))
501506 {
502507 if (ll.leftMin != ll.rightMin )
@@ -513,9 +518,13 @@ bool ViewshedExecutor::processFirstLine(Lines &lines)
513518 else
514519 {
515520 CPLJobQueuePtr pQueue = m_pool.CreateJobQueue ();
521+ /* *
516522 pQueue->SubmitJob([&]() { processFirstLineLeft(ll, lines); });
517523 pQueue->SubmitJob([&]() { processFirstLineRight(ll, lines); });
518524 pQueue->WaitCompletion();
525+ **/
526+ processFirstLineLeft (ll, lines);
527+ processFirstLineRight (ll, lines);
519528 }
520529 sdCalc = false ;
521530 };
@@ -871,6 +880,11 @@ void ViewshedExecutor::processLineLeft(int nYOffset, LineLimits &ll,
871880 else
872881 dfZ = oZcalc (nXOffset, nYOffset, lines.cur [iPixel + 1 ],
873882 lines.prev [iPixel], lines.prev [iPixel + 1 ]);
883+ if (nLine == 2424 && iPixel == 530 )
884+ {
885+ std::cerr << " Val/SD val/dfZ = " << lines.cur [iPixel] << " /" <<
886+ lines.sd [iPixel] << " /" << dfZ << " !\n " ;
887+ }
874888 setOutput (lines, iPixel, dfZ);
875889 }
876890
@@ -961,6 +975,8 @@ bool ViewshedExecutor::processLine(int nLine, Lines &lines)
961975
962976 // Adjust height of the read line.
963977 LineLimits ll = adjustHeight (nYOffset, lines);
978+ if (sdMode ())
979+ lines.input = lines.cur ;
964980
965981 // Handle the initial position on the line.
966982 if (oCurExtent.containsX (m_nX))
@@ -991,6 +1007,8 @@ bool ViewshedExecutor::processLine(int nLine, Lines &lines)
9911007 if (sdMode ())
9921008 {
9931009 lines.cur = std::move (lines.input );
1010+ if (nLine == 2424 )
1011+ std::cerr << " Cur[530] = " << lines.cur [530 ] << " !\n " ;
9941012 process (true );
9951013 }
9961014
0 commit comments