Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14 from melowntech/meta/v5
Browse files Browse the repository at this point in the history
meta/v5: generating metatile version 5
  • Loading branch information
vaclavblazek authored Mar 31, 2021
2 parents af2019a + 16b3a6c commit 33fab01
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 24 deletions.
2 changes: 1 addition & 1 deletion externals/buildsys/common
2 changes: 1 addition & 1 deletion externals/libgeo
2 changes: 1 addition & 1 deletion externals/libhttp
Submodule libhttp updated 2 files
+3 −2 http/http.cpp
+7 −4 http/sink.hpp
2 changes: 1 addition & 1 deletion externals/libmath
9 changes: 8 additions & 1 deletion mapproxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ enable_OpenMP()

find_package(Boost 1.46 REQUIRED
COMPONENTS thread program_options filesystem system date_time
serialization regex chrono iostreams)
serialization regex chrono iostreams)
link_directories(${Boost_LIBRARY_DIRS})
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})

if(${Boost_VERSION_MAJOR}.${Boost_VERSION_MINOR} VERSION_GREATER_EQUAL 1.73)
# Since Boost.Python and Boost.Iostreams in Boost >=1.73 still include
# deprecated headers we need to silence compiler
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS
-DBOOST_ALLOW_DEPRECATED_HEADERS)
endif()

find_package(OpenCV REQUIRED)

find_package(GDAL REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion mapproxy/src/mapproxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ define_module(LIBRARY mapproxy-core
DEPENDS
qmf semantic
pysupport pydbglog
vts-libs>=2.4 http>=1.0 geo>=1.28 geometry>=1.7
vts-libs>=2.18 http>=1.0 geo>=1.28 geometry>=1.7
jsoncpp>=2.1

Boost_SERIALIZATION
Expand Down
19 changes: 11 additions & 8 deletions mapproxy/src/mapproxy/generator/metatile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions mapproxy/src/mapproxy/generator/surface-spheroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void SurfaceSpheroid::generateMetatile(const vts::TileId &tileId

// compute tile extents and height range
auto heightRange(vs::Range<double>::emptyRange());
math::Extents3 te(math::InvalidExtents{});
// math::Extents3 te(math::InvalidExtents{});
double area(0);
int triangleCount(0);
double avgHeightSum(0.f);
Expand All @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 33fab01

Please sign in to comment.