diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/FeatureMergeTest.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/FeatureMergeTest.java index 0fd1628ca3..4a3a38ca16 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/FeatureMergeTest.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/FeatureMergeTest.java @@ -626,13 +626,13 @@ void testExtractConnectedComponents() { @ParameterizedTest @CsvSource({ "bostonbuildings.mbtiles, 2477, 3028, 13, 1141", - "bostonbuildings.mbtiles, 2481, 3026, 13, 948", + "bostonbuildings.mbtiles, 2481, 3026, 13, 949", "bostonbuildings.mbtiles, 2479, 3028, 13, 1074", "jakartabuildings.mbtiles, 6527, 4240, 13, 410" }) void testMergeManyPolygons__TAKES_A_MINUTE_OR_TWO(String file, int x, int y, int z, int expected) throws IOException, GeometryException { - LOGGER.warn("Testing complex polygon merging for " + file + " " + z + "/" + x + "/" + y + " ..."); + LOGGER.warn("Testing complex polygon merging for {} {}/{}/{} ...", file, z, x, y); try (var db = Mbtiles.newReadOnlyDatabase(TestUtils.pathToResource(file))) { byte[] tileData = db.getTile(x, y, z); byte[] gunzipped = gunzip(tileData); @@ -776,7 +776,7 @@ void testMultigeometryMerger( } @Test - void removePointsOutsideBufferEmpty() throws GeometryException { + void removePointsOutsideBufferEmpty() { assertEquals( List.of(), FeatureMerge.removePointsOutsideBuffer(List.of(), 4d) diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/geo/GeoUtilsTest.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/geo/GeoUtilsTest.java index dead314178..76c4076cc8 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/geo/GeoUtilsTest.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/geo/GeoUtilsTest.java @@ -372,7 +372,8 @@ void testSnapAndFixIssue511() throws ParseException, GeometryException { MULTIPOLYGON (((198.83750000000003 46.07500000000004, 199.0625 46.375, 199.4375 46.0625, 199.5 46.43750000000001, 199.5625 46, 199.3125 45.5, 198.8912037037037 46.101851851851876, 198.83750000000003 46.07500000000004)), ((198.43750000000003 46.49999999999999, 198.5625 46.43750000000001, 198.6875 46.25, 198.1875 46.25, 198.43750000000003 46.49999999999999)), ((198.6875 46.25, 198.81249999999997 46.062500000000014, 198.6875 46.00000000000002, 198.6875 46.25)), ((196.55199579831933 46.29359243697479, 196.52255639097743 46.941259398496236, 196.5225563909774 46.941259398496236, 196.49999999999997 47.43750000000001, 196.875 47.125, 197 47.5625, 197.47880544905414 46.97729334004497, 197.51505401161464 46.998359569801956, 197.25 47.6875, 198.0625 47.6875, 198.5 46.625, 198.34375 46.546875, 198.34375000000003 46.54687499999999, 197.875 46.3125, 197.875 46.25, 197.875 46.0625, 197.82894736842107 46.20065789473683, 197.25 46.56250000000001, 197.3125 46.125, 196.9375 46.1875, 196.9375 46.21527777777778, 196.73250000000002 46.26083333333334, 196.5625 46.0625, 196.55199579831933 46.29359243697479)), ((196.35213414634146 45.8170731707317, 197.3402027027027 45.93108108108108, 197.875 45.99278846153846, 197.875 45.93750000000002, 197.93749999999997 45.99999999999999, 197.9375 46, 197.90625 45.96874999999999, 197.90625 45.96875, 196.75000000000006 44.81250000000007, 197.1875 45.4375, 196.3125 45.8125, 196.35213414634146 45.8170731707317)), ((195.875 46.124999999999986, 195.8125 46.5625, 196.5 46.31250000000001, 195.9375 46.4375, 195.875 46.124999999999986)), ((196.49999999999997 46.93749999999999, 196.125 46.875, 196.3125 47.125, 196.49999999999997 46.93749999999999))) """), Stats.inMemory(), "test"); - assertEquals(3.146484375, result.getArea(), 1e-5); + assertTrue(result.isValid()); + assertEquals(3.083984375, result.getArea(), 1e-5); } @Test @@ -421,33 +422,6 @@ void testSnapAndFixIssue546_2() throws GeometryException, ParseException { assertFalse(Orientation.isCCWArea(result.getCoordinates())); } - @Test - void testSnapAndFixIssue546_3() throws GeometryException, ParseException { - var orig = new WKTReader().read( - """ - POLYGON( - ( - 0 0, - 2 0, - 2 1, - 0 1, - 0 0 - ), - ( - 1.19053596444428 0.9029693332377, - 1.06439281777784 0.92184484124482, - 1.42787640888855 0.8257737683016, - 0.94579086222257 0.5617504680322, - 1.19053596444428 0.9029693332377 - ) - ) - """); - var result = GeoUtils.snapAndFixPolygon(orig, Stats.inMemory(), "test"); - var point = newPoint(1.14602002962965, 0.76978969252622); - assertTrue(result.isValid()); - assertFalse(result.contains(point)); - } - @ParameterizedTest @CsvSource({ "1,0,0", diff --git a/pom.xml b/pom.xml index 1f4a09af24..ca945cefdc 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ true 2.17.2 5.11.0 - 1.19.0 + 1.20.0 https://sonarcloud.io onthegomap onthegomap_planetiler