diff --git a/test/geopackage/GeoPackage_Test.cpp b/test/geopackage/GeoPackage_Test.cpp index 48516a02cb..391e3cd150 100644 --- a/test/geopackage/GeoPackage_Test.cpp +++ b/test/geopackage/GeoPackage_Test.cpp @@ -60,6 +60,21 @@ TEST_F(GeoPackage_Test, geopackage_read_test) ASSERT_TRUE(third == nullptr); } +TEST_F(GeoPackage_Test, geopackage_idsubset_test) +{ + const auto gpkg = geopackage::read(this->path, "test", { "First" }); + EXPECT_NE(gpkg->find("First"), -1); + EXPECT_EQ(gpkg->find("Second"), -1); + + const auto& first = gpkg->get_feature(0); + EXPECT_EQ(first->get_id(), "First"); + const auto& point = boost::get(first->geometry()); + EXPECT_EQ(point.get<0>(), 102.0); + EXPECT_EQ(point.get<1>(), 0.5); + + ASSERT_TRUE(gpkg->get_feature(1) == nullptr); +} + // this test is essentially the same as the above, however, the coordinates // are stored in EPSG:3857. When read in, they should convert to EPSG:4326. TEST_F(GeoPackage_Test, geopackage_projection_test) @@ -84,4 +99,4 @@ TEST_F(GeoPackage_Test, geopackage_projection_test) EXPECT_NEAR(point.get<1>(), 0.5, 0.0001); ASSERT_TRUE(third == nullptr); -} \ No newline at end of file +}