[geos-commits] [SCM] GEOS branch main updated. 20c5648b2774de312f0a5d03fb6c9354a42dd0af

git at osgeo.org git at osgeo.org
Tue Jul 8 14:41:43 PDT 2025


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  20c5648b2774de312f0a5d03fb6c9354a42dd0af (commit)
      from  76d6074e6565d863e157076664cc89e6944f0a0c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 20c5648b2774de312f0a5d03fb6c9354a42dd0af
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jul 8 14:41:19 2025 -0700

    Remove unused implementation of GeometryPrecisionReducer

diff --git a/src/precision/PrecisionReducerCoordinateOperation.cpp b/src/precision/PrecisionReducerCoordinateOperation.cpp
deleted file mode 100644
index 4f0338821..000000000
--- a/src/precision/PrecisionReducerCoordinateOperation.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2012 Sandro Santilli <strk at kbt.io>
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Public Licence as published
- * by the Free Software Foundation.
- * See the COPYING file for more information.
- *
- ***********************************************************************
- *
- * Last port: precision/PrecisionreducerCoordinateOperation.java r591 (JTS-1.12)
- *
- **********************************************************************/
-
-#include <geos/precision/PrecisionReducerCoordinateOperation.h>
-#include <geos/geom/PrecisionModel.h>
-#include <geos/geom/CoordinateSequence.h>
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/Geometry.h>
-#include <geos/geom/LineString.h>
-#include <geos/geom/LinearRing.h>
-#include <geos/operation/valid/RepeatedPointRemover.h>
-#include <geos/util.h>
-
-#include <vector>
-
-using namespace geos::geom;
-
-namespace geos {
-namespace precision { // geos.precision
-
-std::unique_ptr<CoordinateSequence>
-PrecisionReducerCoordinateOperation::edit(const CoordinateSequence* cs,
-        const Geometry* geom)
-{
-    auto csSize = cs->size();
-
-    if(csSize == 0) {
-        return nullptr;
-    }
-
-    auto reducedCoords = detail::make_unique<CoordinateSequence>(csSize);
-
-    // copy coordinates and reduce
-    for(std::size_t i = 0; i < csSize; ++i) {
-        (*reducedCoords)[i] = cs->getAt(i);
-        targetPM.makePrecise((*reducedCoords)[i]);
-    }
-
-    // remove repeated points, to simplify returned geometry as
-    // much as possible.
-    std::unique_ptr<CoordinateSequence> noRepeatedCoords = operation::valid::RepeatedPointRemover::removeRepeatedPoints(reducedCoords.get());
-
-    /*
-     * Check to see if the removal of repeated points
-     * collapsed the coordinate List to an invalid length
-     * for the type of the parent geometry.
-     * It is not necessary to check for Point collapses,
-     * since the coordinate list can
-     * never collapse to less than one point.
-     * If the length is invalid, return the full-length coordinate array
-     * first computed, or null if collapses are being removed.
-     * (This may create an invalid geometry - the client must handle this.)
-     */
-    unsigned int minLength = 0;
-    if(dynamic_cast<const LineString*>(geom)) {
-        minLength = 2;
-    }
-    if(dynamic_cast<const LinearRing*>(geom)) {
-        minLength = 4;
-    }
-
-    if(removeCollapsed) {
-        reducedCoords = nullptr;
-    }
-
-    // return null or original length coordinate array
-    if(noRepeatedCoords->getSize() < minLength) {
-        return reducedCoords;
-    }
-
-    // ok to return shorter coordinate array
-    return noRepeatedCoords;
-}
-
-
-} // namespace geos.precision
-} // namespace geos

-----------------------------------------------------------------------

Summary of changes:
 .../PrecisionReducerCoordinateOperation.cpp        | 92 ----------------------
 1 file changed, 92 deletions(-)
 delete mode 100644 src/precision/PrecisionReducerCoordinateOperation.cpp


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list