diff --git a/externals/libmath b/externals/libmath index 551c5fd..6b5b07e 160000 --- a/externals/libmath +++ b/externals/libmath @@ -1 +1 @@ -Subproject commit 551c5fdbfd95b42d5d1049bc322c70cea6fa7b3c +Subproject commit 6b5b07e2074d8faab044cd80b4f309c9b53a202e diff --git a/externals/vts-libs b/externals/vts-libs index f533edf..f5bff04 160000 --- a/externals/vts-libs +++ b/externals/vts-libs @@ -1 +1 @@ -Subproject commit f533edf55458ca2100cffcdb11af5c88c390a105 +Subproject commit f5bff04cde00ccb9cda5f57681cf9a535b036ffe diff --git a/mapproxy/src/mapproxy/generator/metatile.cpp b/mapproxy/src/mapproxy/generator/metatile.cpp index d564a50..55488da 100644 --- a/mapproxy/src/mapproxy/generator/metatile.cpp +++ b/mapproxy/src/mapproxy/generator/metatile.cpp @@ -70,10 +70,13 @@ struct Sample { , max(conv(math::Point3(x, y, value[2]))) , heightRange(navConv(math::Point3(x, y, value[1]))(2) , navConv(math::Point3(x, y, value[2]))(2)) - , ge(geConv(math::Point3(x, y, value[1]))(2) - , geConv(math::Point3(x, y, value[2]))(2) - , geConv(math::Point3(x, y, value[0]))(2)) - {} + { + // ge is invalid so far, update it with extremes + vts::update(ge, geConv(math::Point3(x, y, value[1]))); + vts::update(ge, geConv(math::Point3(x, y, value[2]))); + // set surrogate + ge.surrogate = geConv(math::Point3(x, y, value[0]))(2); + } }; const Sample* getSample(const Sample &sample) @@ -356,7 +359,7 @@ metatileFromDemImpl(const vts::TileId &tileId, Sink &sink, Arsenal &arsenal // compute tile extents and height range auto heightRange(HeightRange::emptyRange()); - math::Extents3 te(math::InvalidExtents{}); + // math::Extents3 te(math::InvalidExtents{}); double area(0.0); int triangleCount(0); double avgHeightSum(0.f); @@ -373,8 +376,8 @@ metatileFromDemImpl(const vts::TileId &tileId, Sink &sink, Arsenal &arsenal // update tile extents (if sample valid) if (p) { // update by both minimum and maximum - math::update(te, p->min); - math::update(te, p->max); + // math::update(te, p->min); + // math::update(te, p->max); vts::update(node.geomExtents, p->ge); avgHeightSum += p->ge.surrogate; ++avgHeightCount; @@ -403,7 +406,7 @@ metatileFromDemImpl(const vts::TileId &tileId, Sink &sink, Arsenal &arsenal setChildren(block, nodeId, node); // set extents - node.extents = vr::normalizedExtents(rf, te); + // node.extents = vr::normalizedExtents(rf, te); // build height range node.heightRange.min = std::floor(heightRange.min); diff --git a/mapproxy/src/mapproxy/generator/surface-spheroid.cpp b/mapproxy/src/mapproxy/generator/surface-spheroid.cpp index cca3afb..ea67892 100644 --- a/mapproxy/src/mapproxy/generator/surface-spheroid.cpp +++ b/mapproxy/src/mapproxy/generator/surface-spheroid.cpp @@ -368,7 +368,7 @@ void SurfaceSpheroid::generateMetatile(const vts::TileId &tileId // compute tile extents and height range auto heightRange(vs::Range::emptyRange()); - math::Extents3 te(math::InvalidExtents{}); + // math::Extents3 te(math::InvalidExtents{}); double area(0); int triangleCount(0); double avgHeightSum(0.f); @@ -383,14 +383,14 @@ void SurfaceSpheroid::generateMetatile(const vts::TileId &tileId // update tile extents (if point valid) if (p) { - math::update(te, *p); + // math::update(te, *p); // convert point to proper SDS - const auto sdsHeight(geConv(*p)[2]); + const auto sdPoint(geConv(*p)); // update geom extents - vts::update(node.geomExtents, sdsHeight); + vts::update(node.geomExtents, sdPoint); // accumulate average height (surrogate) calculator - avgHeightSum += sdsHeight; + avgHeightSum += sdPoint(2); ++avgHeightCount; } @@ -424,7 +424,7 @@ void SurfaceSpheroid::generateMetatile(const vts::TileId &tileId } // set extents - node.extents = vr::normalizedExtents(rf, te); + // node.extents = vr::normalizedExtents(rf, te); // build height range node.heightRange.min = std::floor(heightRange.min);