From 874c2e253bd409174ccac648dc38851edfc7f59e Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 30 Oct 2024 08:25:07 +0100 Subject: [PATCH 1/5] Fix uninstall Makefile rule Syntax confirmed by https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake Closes GH-1187 References GH-1102 when it probably broke --- cmake/cmake_uninstall.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 7492214156..7eab12b3fc 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -31,7 +31,7 @@ foreach(file ${files}) endif() execute_process( - COMMAND "@CMAKE_COMMAND@" -E remove \"$ENV{DESTDIR}${file}\" + COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval) From 23207e9582cd4f74826ca04b28e00b168377bc72 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 30 Oct 2024 12:19:30 +0100 Subject: [PATCH 2/5] Fix removal of include directories by `make uninstall` Closes GH-1189 --- cmake/cmake_uninstall.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in index 7eab12b3fc..ece9ae0a6b 100644 --- a/cmake/cmake_uninstall.cmake.in +++ b/cmake/cmake_uninstall.cmake.in @@ -43,7 +43,7 @@ endforeach() message(STATUS "Deleting ${GEOS_INCLUDE_DIR} directory") execute_process( - COMMAND "@CMAKE_COMMAND@" -E remove_directory \"${GEOS_INCLUDE_DIR}\" + COMMAND "@CMAKE_COMMAND@" -E remove_directory "${GEOS_INCLUDE_DIR}" OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval) From 3dd3b85b9070cfb7e32af86ed9ee6a837c07ef9f Mon Sep 17 00:00:00 2001 From: Martin Davis Date: Tue, 5 Nov 2024 14:45:36 -0800 Subject: [PATCH 3/5] Fix TaggedLineString as per JTS 1096 --- src/simplify/TaggedLineString.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/simplify/TaggedLineString.cpp b/src/simplify/TaggedLineString.cpp index e0dc40ddbf..9a6d09324d 100644 --- a/src/simplify/TaggedLineString.cpp +++ b/src/simplify/TaggedLineString.cpp @@ -169,7 +169,7 @@ TaggedLineString::extractCoordinates( if(size) { for(std::size_t i = 0; i < size; i++) { - TaggedLineSegment* seg = segs[i]; + TaggedLineSegment* seg = segs[i]; assert(seg); pts->add(seg->p0); } @@ -185,7 +185,6 @@ TaggedLineString::extractCoordinates( const Coordinate& TaggedLineString::getCoordinate(std::size_t i) const { - return parentLine->getCoordinateN(i); } @@ -198,6 +197,10 @@ TaggedLineString::size() const const Coordinate& TaggedLineString::getComponentPoint() const { + //-- when simplified use a valid coordinate + if (resultSegs.size() > 0) { + return resultSegs[0]->p0; + } return getParentCoordinates()->getAt(1); } From ac051b6fea2ba51ffc7bc1897fbbddeb07cb8c00 Mon Sep 17 00:00:00 2001 From: Martin Davis Date: Tue, 5 Nov 2024 16:24:14 -0800 Subject: [PATCH 4/5] Update NEWS --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index b605e1a622..eef6897a27 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ - Fixes/Improvements: - Fix ConcaveHullOfPolygons nested shell handling (GH-1169, Martin Davis) - Fix RelateNG for computing IM for empty-nonempty cases (Martin Davis) + - Fix TopologyPreservingSimplifier/TaggedLineString to avoid jumping components (JTS-1096, Martin Davis) ## Changes in 3.13.0 2024-09-06 From 3c648f216b961e9b86cca48d368f32e918d573ce Mon Sep 17 00:00:00 2001 From: Martin Davis Date: Sun, 10 Nov 2024 13:21:22 -0800 Subject: [PATCH 5/5] Add TPSimplifier test from GH-1190 --- .../unit/simplify/TopologyPreservingSimplifierTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp b/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp index b257ad8383..d8ab8d615f 100644 --- a/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp +++ b/tests/unit/simplify/TopologyPreservingSimplifierTest.cpp @@ -442,5 +442,15 @@ void object::test<34>() ensure(simplified != nullptr); // no crash } +//-- test from https://github.com/libgeos/geos/issues/1190 +// testPolygonJumping +template<> +template<> +void object::test<35>() +{ + checkTPS("MULTIPOLYGON (((689.333567 5733.539399, 689.335754 5733.534616, 689.338414 5733.528808, 689.33878 5733.528007, 689.339295 5733.526884, 689.343502 5733.53001, 689.364663 5733.545752, 689.376307 5733.554418, 689.390955 5733.565421, 689.401872 5733.573364, 689.449408 5733.60852, 689.449575 5733.609988, 689.448713 5733.61218, 689.450278 5733.61347, 689.452433 5733.614861, 689.46186 5733.617409, 689.455824 5733.632539, 689.45904 5733.635609, 689.458981 5733.646089, 689.447304 5733.646901, 689.434534 5733.647491, 689.40922 5733.642907, 689.320546 5733.620868, 689.302885 5733.61643, 689.301333 5733.616007, 689.300102 5733.615673, 689.30643 5733.600999, 689.310466 5733.59152, 689.318738 5733.572875, 689.321855 5733.565499, 689.326805 5733.554307, 689.331263 5733.544428, 689.333567 5733.539399)), ((689.488158 5733.746304, 689.48107 5733.739996, 689.48063 5733.740474, 689.471494 5733.732342, 689.466433 5733.727847, 689.447733 5733.712239, 689.437049 5733.709591, 689.41159 5733.702871, 689.378682 5733.693749, 689.326133 5733.678786, 689.295154 5733.685694, 689.287831 5733.686429, 689.286696 5733.686462, 689.276607 5733.686729, 689.260516 5733.685316, 689.23796 5733.680098, 689.242448 5733.667716, 689.254068 5733.635631, 689.258549 5733.623249, 689.258994 5733.622025, 689.250964 5733.620168, 689.253227 5733.613915, 689.275563 5733.619278, 689.296484 5733.624484, 689.390817 5733.647146, 689.390653 5733.651596, 689.453214 5733.669852, 689.456439 5733.665903, 689.460803 5733.666259, 689.464728 5733.671599, 689.467162 5733.67151, 689.540893 5733.636477, 689.558474 5733.626375, 689.571555 5733.61169, 689.606543 5733.552572, 689.611314 5733.553806, 689.635373 5733.569048, 689.64516 5733.573331, 689.679568 5733.588383, 689.673051 5733.603569, 689.688729 5733.608809, 689.674072 5733.643497, 689.683092 5733.646634, 689.673195 5733.672489, 689.645333 5733.669085, 689.635065 5733.690144, 689.62618 5733.712606, 689.601513 5733.71146, 689.592455 5733.71255, 689.586614 5733.714174, 689.580087 5733.717612, 689.570186 5733.725689, 689.557792 5733.763414, 689.55541 5733.762513, 689.554633 5733.762213, 689.547236 5733.765316, 689.545484 5733.767219, 689.506862 5733.759554, 689.491458 5733.748451, 689.488158 5733.746304)))", + 0.1, + "MULTIPOLYGON (((689.300102 5733.615673, 689.46186 5733.617409, 689.458981 5733.646089, 689.300102 5733.615673)), ((689.488158 5733.746304, 689.23796 5733.680098, 689.253227 5733.613915, 689.467162 5733.67151, 689.679568 5733.588383, 689.488158 5733.746304)))"); +} } // namespace tut