[geos-commits] [SCM] GEOS branch master updated. c82abc242a3f4ffdd3da5fbe34945e4027273345

git at osgeo.org git at osgeo.org
Sun Sep 15 14:05:00 PDT 2019


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, master has been updated
       via  c82abc242a3f4ffdd3da5fbe34945e4027273345 (commit)
       via  1aaa406e97488d34de62d3fd40ea1a4b7e66c638 (commit)
       via  eef7fa11856e63d9836c31a0b7ecfe688af71440 (commit)
      from  eb5673a656c5f7f226b54246bbab6e0c8c64a37d (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 c82abc242a3f4ffdd3da5fbe34945e4027273345
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sun Sep 15 17:03:45 2019 -0400

    Simplify QuadEdgeSubdivision::getVoronoiCellPolygon
    
    Avoid conversions between unmanaged and managed pointers.
    Avoid creating a coordinate sequence inconsistent with implementation
    used in GeometryFactory.

diff --git a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
index 2fccbad..6352459 100644
--- a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
+++ b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
@@ -591,9 +591,8 @@ QuadEdgeSubdivision::getVoronoiCellPolygon(const QuadEdge* qe, const geom::Geome
         cellPts.push_back(cellPts.back());
     }
 
-    std::unique_ptr<CoordinateSequence> seq(new CoordinateArraySequence(std::move(cellPts)));
-
-    std::unique_ptr<geom::Geometry> cellPoly(geomFact.createPolygon(geomFact.createLinearRing(seq.release()), nullptr));
+    auto seq = geomFact.getCoordinateSequenceFactory()->create(std::move(cellPts));
+    auto cellPoly = geomFact.createPolygon(geomFact.createLinearRing(std::move(seq)));
 
     // FIXME why is this returning a pointer to a local variable?
     Vertex v = startQE->orig();

commit 1aaa406e97488d34de62d3fd40ea1a4b7e66c638
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sun Sep 15 17:00:24 2019 -0400

    Simplify WKTReader::readPolygonText
    
    Use factory method for building empty polygons.

diff --git a/src/io/WKTReader.cpp b/src/io/WKTReader.cpp
index d89f1b0..fcff5be 100644
--- a/src/io/WKTReader.cpp
+++ b/src/io/WKTReader.cpp
@@ -352,7 +352,7 @@ WKTReader::readPolygonText(StringTokenizer* tokenizer)
 {
     string nextToken = getNextEmptyOrOpener(tokenizer);
     if(nextToken == "EMPTY") {
-        return std::unique_ptr<Polygon>(geometryFactory->createPolygon(nullptr, nullptr));
+        return std::unique_ptr<Polygon>(geometryFactory->createPolygon());
     }
 
     std::vector<std::unique_ptr<LinearRing>> holes;

commit eef7fa11856e63d9836c31a0b7ecfe688af71440
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sun Sep 15 16:58:55 2019 -0400

    Simplify ConvexHull::lineOrPolygon
    
    Avoid converting back and forth between managed and raw pointers.

diff --git a/src/algorithm/ConvexHull.cpp b/src/algorithm/ConvexHull.cpp
index 3e8b7be..2fd08b3 100644
--- a/src/algorithm/ConvexHull.cpp
+++ b/src/algorithm/ConvexHull.cpp
@@ -346,12 +346,11 @@ ConvexHull::lineOrPolygon(const Coordinate::ConstVect& input)
     if(cleaned.size() == 3) { // shouldn't this be 2 ??
         cleaned.resize(2);
         auto cl1 = toCoordinateSequence(cleaned);
-        std::unique_ptr<Geometry> ret(geomFactory->createLineString(cl1.release()));
-        return ret;
+        return geomFactory->createLineString(std::move(cl1));
     }
     auto cl2 = toCoordinateSequence(cleaned);
-    LinearRing* linearRing = geomFactory->createLinearRing(cl2.release());
-    return std::unique_ptr<Geometry>(geomFactory->createPolygon(linearRing, nullptr));
+    std::unique_ptr<LinearRing> linearRing = geomFactory->createLinearRing(std::move(cl2));
+    return geomFactory->createPolygon(std::move(linearRing));
 }
 
 /*private*/

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

Summary of changes:
 src/algorithm/ConvexHull.cpp                     | 7 +++----
 src/io/WKTReader.cpp                             | 2 +-
 src/triangulate/quadedge/QuadEdgeSubdivision.cpp | 5 ++---
 3 files changed, 6 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list