Skip to content
Permalink
Browse files

[3d] Add a tiny padding to the vector layer chunk loader root boundin…

…g box to avoid points at edge chopped off
  • Loading branch information
nirvn committed Dec 24, 2020
1 parent 129ebbb commit 54667e310d0a106f2e9f0f86b00199c77088a29e
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/3d/qgsvectorlayerchunkloader_p.cpp
@@ -142,6 +142,13 @@ QgsVectorLayerChunkLoaderFactory::QgsVectorLayerChunkLoaderFactory( const Qgs3DM
, mLeafLevel( leafLevel )
{
QgsAABB rootBbox = Qgs3DUtils::layerToWorldExtent( vl->extent(), zMin, zMax, vl->crs(), map.origin(), map.crs(), map.transformContext() );
// add small padding to avoid clipping of point features located at the edge of the bounding box
rootBbox.xMin -= 1.0;
rootBbox.xMax += 1.0;
rootBbox.yMin -= 1.0;
rootBbox.yMax += 1.0;
rootBbox.zMin -= 1.0;
rootBbox.zMax += 1.0;
setupQuadtree( rootBbox, -1, leafLevel ); // negative root error means that the node does not contain anything
}

0 comments on commit 54667e3

Please sign in to comment.
You can’t perform that action at this time.