Skip to content

Commit 6e3364f

Browse files
authored
Merge pull request #54745 from pblottiere/pc_profile_loop
Deactivate profile progress bar when no nodes
2 parents 6b6102c + 5620ed7 commit 6e3364f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/core/pointcloud/qgspointcloudlayerprofilegenerator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ bool QgsPointCloudLayerProfileGenerator::generateProfile( const QgsProfileGenera
470470
}
471471
double rootErrorPixels = rootErrorInMapCoordinates / mapUnitsPerPixel; // in pixels
472472
const QVector<IndexedPointCloudNode> nodes = traverseTree( pc, pc->root(), maximumErrorPixels, rootErrorPixels, context.elevationRange() );
473+
if ( nodes.empty() )
474+
{
475+
return false;
476+
}
473477

474478
const double rootErrorInLayerCoordinates = rootNodeExtentLayerCoords.width() / pc->span();
475479
const double maxErrorInMapCoordinates = maximumErrorPixels * mapUnitsPerPixel;

tests/src/python/test_qgspointcloudlayerprofilegenerator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def testProfileGeneration(self):
6666
req.setCrs(pcl.crs())
6767
# zero tolerance => no points
6868
generator = pcl.createProfileGenerator(req)
69-
self.assertTrue(generator.generateProfile())
69+
self.assertFalse(generator.generateProfile())
7070
results = generator.takeResults()
71-
self.assertFalse(results.distanceToHeightMap())
71+
self.assertTrue(results is None)
7272

7373
req.setTolerance(0.05)
7474
generator = pcl.createProfileGenerator(req)

0 commit comments

Comments
 (0)