|
version:osg 2.2 vpb 0.9.5
osgdem分块策略:
1 首先假定resolutionSensitivityScale=0.9;
2 计算纹理和高程图的最大分辨率computeMaximumSourceResolution;
_imagery_maxSourceResolutionX,_imagery_maxSourceResolutionY;//纹理
_terrain_maxSourceResolutionX,_terrain_maxSourceResolutionY;//高程
3 计算每块纹理和高程图的分辨率computeImageResolution
texture_dx,texture_dy;//纹理
dem_dx,dem_dy;//高程
4 分块
1)基于分辨率的分块法则:
if (tile->computeImageResolution(layerNum,texture_numColumns,texture_numRows,texture_dx,texture_dy))
{
if (texture_dx*resolutionSensitivityScale>tile->_imagery[layerNum]._imagery_maxSourceResolutionX) needToDivideX = true;
if (texture_dy*resolutionSensitivityScale>tile->_imagery[layerNum]._imagery_maxSourceResolutionY) needToDivideY = true;
}
if (tile->computeTerrainResolution(dem_numColumns,dem_numRows,dem_dx,dem_dy))
{
if (dem_dx*resolutionSensitivityScale>tile->_imagery[layerNum]._terrain_maxSourceResolutionX) needToDivideX = true;
if (dem_dy*resolutionSensitivityScale>tile->_imagery[layerNum]._terrain_maxSourceResolutionY) needToDivideY = true;
}
2)在满足needToDivideX = true,needToDivideY = true的条件下,块本身几何形状决定的分块法则
if (needToDivideX && needToDivideY)
{
float aspectRatio = (extents.yMax()- extents.yMin())/(extents.xMax()- extents.xMin());
if (aspectRatio>1.414) needToDivideX = false;
else if (aspectRatio<.707) needToDivideY = false;
}
5 划分可能结果:一分为四或者一分为二。 不当之处,敬请指正。 |
|