fix(vtk): 拉最远仍加载超大面积根因=比范围还大的粗瓦盖住数据中心过了距离剔除;改为瓦片大于范围则强制细分,真正限定在动态范围内

This commit is contained in:
gaozheng 2026-06-17 18:05:30 +08:00
parent 223b8ecf70
commit 3635f295b2
1 changed files with 3 additions and 1 deletions

View File

@ -234,7 +234,9 @@ void TileBasemap::refineTile(int z, int x, int y, std::set<long long>& out, int&
const double dist = std::max(1.0, std::sqrt(dx * dx + dy * dy + dz * dz)); const double dist = std::max(1.0, std::sqrt(dx * dx + dy * dy + dz * dz));
screenPx = g * projK_ / dist; // 透视projK_ = H/(2·tan(vfov/2)) screenPx = g * projK_ / dist; // 透视projK_ = H/(2·tan(vfov/2))
} }
if (screenPx > kTargetPx && z < kMaxZoom) { // 细分条件:屏幕上太大 → 细分(近细远粗);或瓦片本身比允许范围还大 → 也强制细分,
// 否则拉到最远时一块巨瓦(如 78km)正好盖住数据中心、过不了距离剔除 → 覆盖超大面积。
if ((screenPx > kTargetPx || g > maxTileDist_) && z < kMaxZoom) {
refineTile(z + 1, 2 * x, 2 * y, out, count); refineTile(z + 1, 2 * x, 2 * y, out, count);
refineTile(z + 1, 2 * x + 1, 2 * y, out, count); refineTile(z + 1, 2 * x + 1, 2 * y, out, count);
refineTile(z + 1, 2 * x, 2 * y + 1, out, count); refineTile(z + 1, 2 * x, 2 * y + 1, out, count);