Skip to content

Commit

Permalink
Merge pull request qgis#54745 from pblottiere/pc_profile_loop
Browse files Browse the repository at this point in the history
Deactivate profile progress bar when no nodes
  • Loading branch information
pblottiere authored Oct 2, 2023
2 parents 6b6102c + 5620ed7 commit 6e3364f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/core/pointcloud/qgspointcloudlayerprofilegenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ bool QgsPointCloudLayerProfileGenerator::generateProfile( const QgsProfileGenera
}
double rootErrorPixels = rootErrorInMapCoordinates / mapUnitsPerPixel; // in pixels
const QVector<IndexedPointCloudNode> nodes = traverseTree( pc, pc->root(), maximumErrorPixels, rootErrorPixels, context.elevationRange() );
if ( nodes.empty() )
{
return false;
}

const double rootErrorInLayerCoordinates = rootNodeExtentLayerCoords.width() / pc->span();
const double maxErrorInMapCoordinates = maximumErrorPixels * mapUnitsPerPixel;
Expand Down
4 changes: 2 additions & 2 deletions tests/src/python/test_qgspointcloudlayerprofilegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def testProfileGeneration(self):
req.setCrs(pcl.crs())
# zero tolerance => no points
generator = pcl.createProfileGenerator(req)
self.assertTrue(generator.generateProfile())
self.assertFalse(generator.generateProfile())
results = generator.takeResults()
self.assertFalse(results.distanceToHeightMap())
self.assertTrue(results is None)

req.setTolerance(0.05)
generator = pcl.createProfileGenerator(req)
Expand Down

0 comments on commit 6e3364f

Please sign in to comment.