Skip to content

Commit

Permalink
lower initial vector layer estimated z range
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Aug 18, 2023
1 parent 3e14c92 commit 9feb235
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/3d/qgsrulebased3drenderer.cpp
Expand Up @@ -388,14 +388,13 @@ Qt3DCore::QEntity *QgsRuleBased3DRenderer::createEntity( const Qgs3DMapSettings
if ( !vl )
return nullptr;

// we start with a maximal z range (based on a number similar to the radius of the Earth),
// because we can't know this upfront. There's too many
// we start with a maximal z range because we can't know this upfront. There's too many
// factors to consider eg vertex z data, terrain heights, data defined offsets and extrusion heights,...
// This range will be refined after populating the nodes to the actual z range of the generated chunks nodes.
// Assuming the vertical height is in meter, then it's extremely unlikely that a real vertical
// height will exceed this amount!
constexpr double MINIMUM_VECTOR_Z_ESTIMATE = -5000000;
constexpr double MAXIMUM_VECTOR_Z_ESTIMATE = 5000000;
constexpr double MINIMUM_VECTOR_Z_ESTIMATE = -100000;
constexpr double MAXIMUM_VECTOR_Z_ESTIMATE = 100000;

return new QgsRuleBasedChunkedEntity( vl, MINIMUM_VECTOR_Z_ESTIMATE, MAXIMUM_VECTOR_Z_ESTIMATE, tilingSettings(), mRootRule, map );
}
Expand Down
7 changes: 3 additions & 4 deletions src/3d/qgsvectorlayer3drenderer.cpp
Expand Up @@ -70,14 +70,13 @@ Qt3DCore::QEntity *QgsVectorLayer3DRenderer::createEntity( const Qgs3DMapSetting
if ( !mSymbol || !vl )
return nullptr;

// we start with a maximal z range (based on a number similar to the radius of the Earth),
// because we can't know this upfront. There's too many
// we start with a maximal z range because we can't know this upfront. There's too many
// factors to consider eg vertex z data, terrain heights, data defined offsets and extrusion heights,...
// This range will be refined after populating the nodes to the actual z range of the generated chunks nodes.
// Assuming the vertical height is in meter, then it's extremely unlikely that a real vertical
// height will exceed this amount!
constexpr double MINIMUM_VECTOR_Z_ESTIMATE = -5000000;
constexpr double MAXIMUM_VECTOR_Z_ESTIMATE = 5000000;
constexpr double MINIMUM_VECTOR_Z_ESTIMATE = -100000;
constexpr double MAXIMUM_VECTOR_Z_ESTIMATE = 100000;
return new QgsVectorLayerChunkedEntity( vl, MINIMUM_VECTOR_Z_ESTIMATE, MAXIMUM_VECTOR_Z_ESTIMATE, tilingSettings(), mSymbol.get(), map );
}

Expand Down

0 comments on commit 9feb235

Please sign in to comment.