summaryrefslogtreecommitdiff
path: root/test/util/tile_cover.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/util/tile_cover.test.cpp')
-rw-r--r--test/util/tile_cover.test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/util/tile_cover.test.cpp b/test/util/tile_cover.test.cpp
index 7defa761af..eb65c6686a 100644
--- a/test/util/tile_cover.test.cpp
+++ b/test/util/tile_cover.test.cpp
@@ -137,6 +137,17 @@ TEST(TileCover, GeomLineZ10) {
}
+TEST(TileCover, GeomLineRegression11870) {
+ auto lineCover = util::tileCover(LineString<double>{
+ {-121.5063900000001,40.470099999999945},
+ {-121.5065300000001,40.470369999999946},
+ {-121.5065900000001,40.470519999999944},
+ }, 14);
+ EXPECT_EQ((std::vector<UnwrappedTileID>{ { 14, 2662, 6174 } }),
+ lineCover);
+
+}
+
TEST(TileCover, WrappedGeomLineZ10) {
auto lineCover = util::tileCover(LineString<double>{
{-179.93342914581299,38.892101707724315},
@@ -263,6 +274,9 @@ TEST(TileCover, GeomInvalid) {
auto point = Point<double>{ -122.5744, 97.6609 };
EXPECT_THROW(util::tileCover(point, 2), std::domain_error);
+ auto badLine = LineString<double>{ {1.0, 35.0} };
+ EXPECT_EQ((std::vector<UnwrappedTileID>{ }), util::tileCover(badLine, 16));
+
auto badPoly = Polygon<double> { { {1.0, 35.0} } };
EXPECT_EQ((std::vector<UnwrappedTileID>{ }), util::tileCover(badPoly, 16));