[Git][debian-gis-team/geos][upstream] New upstream version 3.10.0~rc2

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Sat Oct 16 07:53:46 BST 2021



Bas Couwenberg pushed to branch upstream at Debian GIS Project / geos


Commits:
b4070b03 by Bas Couwenberg at 2021-10-16T08:19:56+02:00
New upstream version 3.10.0~rc2
- - - - -


6 changed files:

- CMakeLists.txt
- Version.txt
- capi/geos_c.h.in
- + configure
- src/deps/CMakeLists.txt
- tests/unit/capi/GEOSGeom_setPrecisionTest.cpp


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -9,9 +9,9 @@
 # See the COPYING file for more information.
 ##############################################################################
 
-# Require CMake 3.8+ with support for meta-features that request compiler
-# modes for specific C/C++ language standard levels.
-cmake_minimum_required(VERSION 3.8)
+# Require CMake 3.13+ with support for meta-features that request compiler
+# modes for specific C/C++ language standard levels, and object libraries.
+cmake_minimum_required(VERSION 3.13)
 
 # Default to release build so packagers don't release debug builds
 set(DEFAULT_BUILD_TYPE Release)


=====================================
Version.txt
=====================================
@@ -5,7 +5,7 @@ GEOS_VERSION_MINOR=10
 GEOS_VERSION_PATCH=0
 
 # OPTIONS: "", "dev", "rc1" etc.
-GEOS_PATCH_WORD=rc1
+GEOS_PATCH_WORD=rc2
 
 # GEOS CAPI Versions
 #


=====================================
capi/geos_c.h.in
=====================================
@@ -1384,9 +1384,11 @@ extern int GEOS_DLL GEOSNormalize_r(
 * when altering the precision of a geometry.
 */
 enum GEOSPrecisionRules {
-    /** This option causes GEOSGeom_setPrecision_r() to not attempt at preserving the topology */
+    /** The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed. */
+    GEOS_PREC_VALID_OUTPUT = 0,
+    /** Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called "GEOS_PREC_POINTWISE" - the current name is historical.) */
     GEOS_PREC_NO_TOPO = 1,
-    /** This option causes GEOSGeom_setPrecision_r() to retain collapsed elements */
+    /** Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed. */
     GEOS_PREC_KEEP_COLLAPSED = 2
 };
 
@@ -3759,6 +3761,15 @@ extern int GEOS_DLL GEOSNormalize(GEOSGeometry* g);
 * of the geometry with higher precision (smaller "gridSize").
 * That same precision will be attached to the operation outputs.
 *
+* In the Default and GEOS_PREC_KEEP_COLLAPSED modes invalid input
+* may cause an error to occur, unless the invalidity is below
+* the scale of the requested precision
+*
+* There are only 3 modes. The GEOS_PREC_NO_TOPO mode
+* takes precedence over GEOS_PREC_KEEP_COLLAPSED.
+* So the combination GEOS_PREC_NO_TOPO || GEOS_PREC_KEEP_COLLAPSED
+* has the same semantics as GEOS_PREC_NO_TOPO
+*
 * \param g Input geometry
 * \param gridSize cell size of grid to round coordinates to,
 *        or 0 for FLOATING precision


=====================================
configure
=====================================
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+which cmake > /dev/null 2>&1 || {
+  echo "You need cmake to build this package" >&2
+  exit 1
+}
+
+srcdir=$(dirname $0)
+
+usage() {
+  echo "$0 [--prefix=<prefix>] [--help]"
+}
+
+cmd=cmake
+
+options=$(getopt -l "help,prefix:" "" "$@")
+#echo XXXX ${options}
+eval set -- "$options"
+
+while true; do
+  case $1 in
+    --prefix)
+      shift
+      cmd="${cmd} -DCMAKE_INSTALL_PREFIX:PATH=$1"
+      ;;
+    --help)
+      usage
+      exit
+      ;;
+    --)
+      shift
+      break
+      ;;
+    *)
+      echo "Unrecognized switch $1" >&2
+      usage >&2
+      exit 1
+      ;;
+  esac
+  shift
+done
+
+cmd="${cmd} ${srcdir}"
+
+echo
+echo "WARNING: this script is a wrapper for cmake"
+echo
+echo "INFO: Invoking ${cmd}"
+echo
+$cmd
+
+echo
+echo "HINT: for interactive configuration use ccmake ${srcdir}"
+echo


=====================================
src/deps/CMakeLists.txt
=====================================
@@ -9,7 +9,7 @@
 # See the COPYING file for more information.
 ################################################################################
 file(GLOB_RECURSE _sources ${CMAKE_CURRENT_LIST_DIR}/*.c  CONFIGURE_DEPEND)
-add_library(ryu STATIC ${_sources})
+add_library(ryu OBJECT ${_sources})
 target_include_directories(ryu PUBLIC ${CMAKE_CURRENT_LIST_DIR})
 set_target_properties(ryu PROPERTIES
   POSITION_INDEPENDENT_CODE ON


=====================================
tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
=====================================
@@ -118,5 +118,45 @@ void object::test<5>
     ensure_equals(toWKT(geom3_), "LINESTRING (0 0, 0 0)");
 }
 
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<6> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, 0);
+    ensure_geometry_equals(geom2_, "LINESTRING EMPTY");
+}
+
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<7> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, GEOS_PREC_NO_TOPO);
+    ensure_geometry_equals(geom2_, "LINESTRING (0 0, 0 0)");
+}
+
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<8> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, GEOS_PREC_KEEP_COLLAPSED);
+    ensure_geometry_equals(geom2_, "LINESTRING (0 0, 0 0)");
+}
+
+// Retain (or not) collapsed elements
+template<>
+template<>
+void object::test<9> ()
+{
+    geom1_ = fromWKT("LINESTRING (0 0, 0.1 0.1)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, GEOS_PREC_KEEP_COLLAPSED | GEOS_PREC_NO_TOPO);
+    ensure_geometry_equals(geom2_, "LINESTRING (0 0, 0 0)");
+}
+
 } // namespace tut
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/geos/-/commit/b4070b033415dbe753a621571abf96120d231ef2

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/geos/-/commit/b4070b033415dbe753a621571abf96120d231ef2
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20211016/d061c169/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list