diff --git a/src/geopackage/CMakeLists.txt b/src/geopackage/CMakeLists.txt index 97f25cdd98..14a8f1324d 100644 --- a/src/geopackage/CMakeLists.txt +++ b/src/geopackage/CMakeLists.txt @@ -3,12 +3,13 @@ cmake_minimum_required(VERSION 3.10) string(COMPARE EQUAL "${CMAKE_CXX_COMPILER_ID}" "IntelLLVM" _cmp) if (NOT _cmp) - message(WARNING "[NGen::geopackage] geometry.cpp cannot be optimized with " - "${CMAKE_CXX_COMPILER_ID} due to a suspected compiler/boost issue. " + message(WARNING "[NGen::geopackage] wkb.cpp cannot be optimized with " + "${CMAKE_CXX_COMPILER_ID} due to a suspected optimizer/boost issue:\n" + "https://github.com/NOAA-OWP/ngen/issues/567.\n" "Use IntelLLVM if optimization for this source file is required.") # !! Required due to optimizer issue with either clang or # !! boost::geometry::srs::transformation - set_source_files_properties(geometry.cpp PROPERTIES COMPILE_FLAGS -O0) + set_source_files_properties(wkb.cpp PROPERTIES COMPILE_FLAGS -O0) endif() add_library(geopackage STATIC geometry.cpp diff --git a/test/geopackage/WKB_Test.cpp b/test/geopackage/WKB_Test.cpp index f0732a979c..13d2819c80 100644 --- a/test/geopackage/WKB_Test.cpp +++ b/test/geopackage/WKB_Test.cpp @@ -147,12 +147,12 @@ TEST_F(WKB_Test, wkb_point_test) // also tests endianness { const auto geom_big = boost::get(wkb::read(this->wkb_bytes["point_big"])); const auto geom_little = boost::get(wkb::read(this->wkb_bytes["point"])); - EXPECT_NEAR(geom_big.get<0>(), geom_little.get<0>(), 0.000001); - EXPECT_NEAR(geom_big.get<1>(), geom_little.get<1>(), 0.000001); - EXPECT_NEAR(geom_big.get<0>(), 2.0, 0.000001); - EXPECT_NEAR(geom_big.get<1>(), 4.0, 0.000001); - EXPECT_NEAR(geom_big.get<0>(), 2.0, 0.000001); - EXPECT_NEAR(geom_big.get<1>(), 4.0, 0.000001); + EXPECT_NEAR(geom_big.get<0>(), geom_little.get<0>(), 1e-6); + EXPECT_NEAR(geom_big.get<1>(), geom_little.get<1>(), 1e-6); + EXPECT_NEAR(geom_big.get<0>(), 2.0, 1e-6); + EXPECT_NEAR(geom_big.get<1>(), 4.0, 1e-6); + EXPECT_NEAR(geom_big.get<0>(), 2.0, 1e-6); + EXPECT_NEAR(geom_big.get<1>(), 4.0, 1e-6); } TEST_F(WKB_Test, wkb_linestring_test) @@ -166,8 +166,8 @@ TEST_F(WKB_Test, wkb_linestring_test) }; for (int i = 0; i < expected_coordinates.size(); i++) { - EXPECT_NEAR(line[i].get<0>(), expected_coordinates[i].first, 0.0001); - EXPECT_NEAR(line[i].get<1>(), expected_coordinates[i].second, 0.0001); + EXPECT_NEAR(line[i].get<0>(), expected_coordinates[i].first, 1e-4); + EXPECT_NEAR(line[i].get<1>(), expected_coordinates[i].second, 1e-4); } } @@ -186,8 +186,8 @@ TEST_F(WKB_Test, wkb_polygon_test) }; for (int i = 0; i < expected_coordinates.size(); i++) { - EXPECT_NEAR(poly.outer().at(i).get<0>(), expected_coordinates[i].first, 0.0001); - EXPECT_NEAR(poly.outer().at(i).get<1>(), expected_coordinates[i].second, 0.0001); + EXPECT_NEAR(poly.outer().at(i).get<0>(), expected_coordinates[i].first, 1e-4); + EXPECT_NEAR(poly.outer().at(i).get<1>(), expected_coordinates[i].second, 1e-4); } } @@ -208,8 +208,8 @@ TEST_F(WKB_Test, wkb_polygon_with_holes_test) }; for (int i = 0; i < expected_outer.size(); i++) { - EXPECT_NEAR(poly.outer()[i].get<0>(), expected_outer[i].first, 0.0001); - EXPECT_NEAR(poly.outer()[i].get<1>(), expected_outer[i].second, 0.0001); + EXPECT_NEAR(poly.outer()[i].get<0>(), expected_outer[i].first, 1e-4); + EXPECT_NEAR(poly.outer()[i].get<1>(), expected_outer[i].second, 1e-4); } const std::vector> expected_inner = { @@ -221,8 +221,8 @@ TEST_F(WKB_Test, wkb_polygon_with_holes_test) }; for (int i = 0; i < expected_inner.size(); i++) { - EXPECT_NEAR(poly.inners().at(0)[i].get<0>(), expected_inner[i].first, 0.0001); - EXPECT_NEAR(poly.inners().at(0)[i].get<1>(), expected_inner[i].second, 0.0001); + EXPECT_NEAR(poly.inners().at(0)[i].get<0>(), expected_inner[i].first, 1e-4); + EXPECT_NEAR(poly.inners().at(0)[i].get<1>(), expected_inner[i].second, 1e-4); } } @@ -237,8 +237,8 @@ TEST_F(WKB_Test, wkb_multipoint_test) }; for (int i = 0; i < expected_coordinates.size(); i++) { - EXPECT_NEAR(mp[i].get<0>(), expected_coordinates[i].first, 0.0001); - EXPECT_NEAR(mp[i].get<1>(), expected_coordinates[i].second, 0.0001); + EXPECT_NEAR(mp[i].get<0>(), expected_coordinates[i].first, 1e-4); + EXPECT_NEAR(mp[i].get<1>(), expected_coordinates[i].second, 1e-4); } } @@ -255,8 +255,8 @@ TEST_F(WKB_Test, wkb_multilinestring_test) for (int i = 0; i < expected_coordinates.size(); i++) { for (int j = 0; j < expected_coordinates[i].size(); j++) { - EXPECT_NEAR(mp[i][j].get<0>(), expected_coordinates[i][j].first, 0.0001); - EXPECT_NEAR(mp[i][j].get<1>(), expected_coordinates[i][j].second, 0.0001); + EXPECT_NEAR(mp[i][j].get<0>(), expected_coordinates[i][j].first, 1e-4); + EXPECT_NEAR(mp[i][j].get<1>(), expected_coordinates[i][j].second, 1e-4); } } }