From 20760344a0c609cb39d9c0eaa930876fcfc8a4fa Mon Sep 17 00:00:00 2001 From: Oliver Wipfli Date: Fri, 8 Nov 2024 22:58:17 +0100 Subject: [PATCH] Add test Harkingen --- .../planetiler/util/LoopLineMergerTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/util/LoopLineMergerTest.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/util/LoopLineMergerTest.java index 285e00cc05..fb91ae0bca 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/util/LoopLineMergerTest.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/util/LoopLineMergerTest.java @@ -256,6 +256,23 @@ void testMergeCarriagewaysWithTwoSplits() { ); } + @Test + void testRealWorldHarkingen() { + var merger = new LoopLineMerger() + .setMinLength(0) + .setLoopMinLength(8 * 0.0625); + + merger.add(newLineString(99.185791015625,109.83056640625, 99.202392578125,109.8193359375, 99.21337890625,109.810302734375, 99.222412109375,109.8017578125, 99.229736328125,109.793701171875, 99.241943359375,109.779541015625)); + merger.add(newLineString(98.9931640625,109.863525390625, 99.005126953125,109.862060546875, 99.01708984375,109.86083984375, 99.028564453125,109.85986328125, 99.040283203125,109.859375, 99.0712890625,109.85791015625, 99.08203125,109.857421875, 99.093017578125,109.856689453125, 99.104248046875,109.855712890625, 99.115478515625,109.8544921875, 99.12646484375,109.852783203125, 99.1376953125,109.850341796875, 99.1474609375,109.84765625, 99.15673828125,109.844482421875, 99.166748046875,109.84033203125, 99.175537109375,109.836181640625, 99.185791015625,109.83056640625)); + merger.add(newLineString(99.162841796875,109.812744140625, 99.0966796875,109.824462890625, 99.055419921875,109.832275390625, 99.008544921875,109.842041015625, 98.967529296875,109.8525390625, 98.8818359375,109.875244140625)); + merger.add(newLineString(98.879150390625,109.885498046875, 98.94091796875,109.86572265625, 98.968017578125,109.859130859375, 99.017578125,109.847412109375, 99.056396484375,109.83984375, 99.09814453125,109.831298828125, 99.163330078125,109.81982421875)); + + assertEquals( + 1, + merger.getMergedLineStrings().size() + ); + } + @ParameterizedTest @CsvSource({ "mergelines_1759_point_line.wkb.gz,0,4",