From a7a12f54371ddefee4e468ef89677ba9305719b1 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 31 Oct 2023 14:30:57 -0700 Subject: [PATCH] Add test of prepared geometry against mixed collections --- tests/unit/geom/prep/PreparedGeometryTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/geom/prep/PreparedGeometryTest.cpp b/tests/unit/geom/prep/PreparedGeometryTest.cpp index efc5c4b821..ffdd90faf0 100644 --- a/tests/unit/geom/prep/PreparedGeometryTest.cpp +++ b/tests/unit/geom/prep/PreparedGeometryTest.cpp @@ -68,4 +68,21 @@ void object::test<1> ensure( pg1->covers(g2.get())); } + +// See https://trac.osgeo.org/postgis/ticket/5601 +template<> +template<> +void object::test<2> +() +{ + g1 = reader.read( "LINESTRING(-1 0,0 0)" ); + g2 = reader.read( "GEOMETRYCOLLECTION(MULTIPOINT(-1 0),LINESTRING(0 -1,1 0))" ); + + pg1 = prep::PreparedGeometryFactory::prepare(g1.get()); + + ensure( g1->intersects(g2.get()) ); + ensure( pg1->intersects(g2.get()) ); +} + + } // namespace tut