[geos-commits] [SCM] GEOS branch master updated. 678955984311120319e88062f19e2ba32121150e

git at osgeo.org git at osgeo.org
Fri Dec 14 10:10:31 PST 2018


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  678955984311120319e88062f19e2ba32121150e (commit)
      from  327680c9fb644b6370274d9486f2756e7892f367 (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 678955984311120319e88062f19e2ba32121150e
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Dec 14 10:10:15 2018 -0800

    Delete obsolete PointInRing classes
    JTS 55fb1113655db08a9a4ce4c17c9ee5912b6aa0f2

diff --git a/include/geos/algorithm/Makefile.am b/include/geos/algorithm/Makefile.am
index 19f13c9..6309cec 100644
--- a/include/geos/algorithm/Makefile.am
+++ b/include/geos/algorithm/Makefile.am
@@ -25,10 +25,7 @@ geos_HEADERS = \
 	LineIntersector.h \
 	MinimumDiameter.h \
 	NotRepresentableException.h \
-	PointInRing.h \
 	PointLocator.h \
 	RayCrossingCounter.h \
 	RayCrossingCounterDD.h \
-	RobustDeterminant.h \
-	SimplePointInRing.h \
-	SIRtreePointInRing.h
+	RobustDeterminant.h
diff --git a/include/geos/algorithm/SIRtreePointInRing.h b/include/geos/algorithm/SIRtreePointInRing.h
deleted file mode 100644
index 6b1e0c3..0000000
--- a/include/geos/algorithm/SIRtreePointInRing.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2005-2006 Refractions Research Inc.
- * Copyright (C) 2001-2002 Vivid Solutions Inc.
- *
- * 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.
- *
- **********************************************************************/
-
-#ifndef GEOS_ALGORITHM_SIRTREEPOINTINRING_H
-#define GEOS_ALGORITHM_SIRTREEPOINTINRING_H
-
-#include <geos/export.h>
-#include <geos/algorithm/PointInRing.h> // for inheritance
-#include <geos/index/strtree/SIRtree.h>
-#include <geos/geom/LineSegment.h>
-
-#include <memory>
-#include <vector>
-
-// Forward declarations
-namespace geos {
-	namespace geom {
-		class Coordinate;
-		class LineSegment;
-		class LinearRing;
-	}
-}
-
-
-namespace geos {
-namespace algorithm { // geos::algorithm
-
-class GEOS_DLL SIRtreePointInRing: public PointInRing {
-private:
-	geom::LinearRing *ring;
-	index::strtree::SIRtree sirTree;
-	std::vector<std::unique_ptr<geom::LineSegment>> segments;
-	int crossings;  // number of segment/ray crossings
-	void buildIndex();
-	void testLineSegment(const geom::Coordinate& p,
-			geom::LineSegment *seg);
-public:
-	SIRtreePointInRing(geom::LinearRing *newRing);
-	~SIRtreePointInRing() override = default;
-	bool isInside(const geom::Coordinate& pt) override;
-};
-
-} // namespace geos::algorithm
-} // namespace geos
-
-
-#endif // GEOS_ALGORITHM_SIRTREEPOINTINRING_H
-
diff --git a/include/geos/geosAlgorithm.h b/include/geos/geosAlgorithm.h
index 1a93e24..5dc6c33 100644
--- a/include/geos/geosAlgorithm.h
+++ b/include/geos/geosAlgorithm.h
@@ -35,12 +35,9 @@
 #include <geos/algorithm/LineIntersector.h>
 //#include <geos/algorithm/MinimumDiameter.h>
 //#include <geos/algorithm/NotRepresentableException.h>
-//#include <geos/algorithm/PointInRing.h>
 #include <geos/algorithm/PointLocator.h>
 //#include <geos/algorithm/RobustDeterminant.h>
-//#include <geos/algorithm/SIRtreePointInRing.h>
 //#include <geos/algorithm/SimplePointInAreaLocator.h>
-//#include <geos/algorithm/SimplePointInRing.h>
 
 namespace geos {
 
diff --git a/src/Makefile.vc b/src/Makefile.vc
index 803d3bd..f67802d 100644
--- a/src/Makefile.vc
+++ b/src/Makefile.vc
@@ -45,8 +45,6 @@ OBJ = \
 	algorithm\PointLocator.$(EXT) \
 	algorithm\RayCrossingCounter.$(EXT) \
 	algorithm\RobustDeterminant.$(EXT) \
-	algorithm\SimplePointInRing.$(EXT) \
-	algorithm\SIRtreePointInRing.$(EXT) \
 	algorithm\distance\DiscreteHausdorffDistance.$(EXT) \
 	algorithm\distance\DiscreteFrechetDistance.$(EXT) \
 	algorithm\distance\DistanceToPoint.$(EXT) \
diff --git a/src/algorithm/Makefile.am b/src/algorithm/Makefile.am
index 062d835..749cbe5 100644
--- a/src/algorithm/Makefile.am
+++ b/src/algorithm/Makefile.am
@@ -26,9 +26,7 @@ libalgorithm_la_SOURCES = \
 	PointLocator.cpp \
 	RayCrossingCounter.cpp \
 	RayCrossingCounterDD.cpp \
-	RobustDeterminant.cpp \
-	SimplePointInRing.cpp \
-	SIRtreePointInRing.cpp
+	RobustDeterminant.cpp
 
 
 libalgorithm_la_LIBADD = \
diff --git a/src/algorithm/SIRtreePointInRing.cpp b/src/algorithm/SIRtreePointInRing.cpp
deleted file mode 100644
index f4b5baf..0000000
--- a/src/algorithm/SIRtreePointInRing.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2005-2006 Refractions Research Inc.
- * Copyright (C) 2001-2002 Vivid Solutions Inc.
- *
- * 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.
- *
- **********************************************************************
- *
- **********************************************************************/
-
-#include <geos/algorithm/CGAlgorithmsDD.h>
-#include <geos/algorithm/SIRtreePointInRing.h>
-#include <geos/algorithm/RobustDeterminant.h>
-#include <geos/index/strtree/SIRtree.h>
-#include <geos/geom/LinearRing.h>
-#include <geos/geom/CoordinateSequence.h>
-#include <geos/geom/LineSegment.h>
-#include <geos/geom/Coordinate.h>
-
-#include <vector>
-
-using namespace std;
-using namespace geos::index::strtree;
-using namespace geos::geom;
-
-namespace geos {
-namespace algorithm { // geos.algorithm
-
-SIRtreePointInRing::SIRtreePointInRing(LinearRing *newRing):
-	PointInRing(),
-	ring(newRing),
-	crossings(0)
-{
-	buildIndex();
-}
-
-void
-SIRtreePointInRing::buildIndex()
-{
-	const CoordinateSequence *pts = ring->getCoordinatesRO();
-
-	const std::size_t npts=pts->getSize();
-	for(std::size_t i=1; i<npts; ++i)
-	{
-		if(pts->getAt(i-1)==pts->getAt(i)) continue; // Optimization suggested by MD. [Jon Aquino]
-		std::unique_ptr<LineSegment> seg{new LineSegment(pts->getAt(i-1), pts->getAt(i))};
-		sirTree.insert(seg->p0.y, seg->p1.y, seg.get());
-		segments.push_back(std::move(seg));
-	}
-}
-
-bool
-SIRtreePointInRing::isInside(const Coordinate& pt)
-{
-	crossings=0;
-	// test all segments intersected by vertical ray at pt
-	std::unique_ptr<vector<void*>> segs{sirTree.query(pt.y)};
-
-	for(const auto& hit : *segs) {
-		LineSegment *seg = static_cast<LineSegment*>(hit);
-		testLineSegment(pt,seg);
-	}
-
-	/*
-	*  p is inside if number of crossings is odd.
-	*/
-	return (crossings % 2) == 1;
-}
-
-void
-SIRtreePointInRing::testLineSegment(const Coordinate& p,LineSegment *seg)
-{
-	double xInt;  // x intersection of segment with ray
-	double x1;    // translated coordinates
-	double y1;
-	double x2;
-	double y2;
-
-	/*
-	*  Test if segment crosses ray from test point in positive x direction.
-	*/
-	Coordinate& p1=seg->p0;
-	Coordinate& p2=seg->p1;
-	x1=p1.x-p.x;
-	y1=p1.y-p.y;
-	x2=p2.x-p.x;
-	y2=p2.y-p.y;
-
-	if (((y1>0) && (y2<=0)) ||
-		((y2>0) && (y1<=0))) {
-		/*
-		*  segment straddles x axis,so compute intersection.
-		*/
-		xInt = CGAlgorithmsDD::signOfDet2x2(x1,y1,x2,y2)/(y2-y1);
-		/*
-		*  crosses ray if strictly positive intersection.
-		*/
-		if (0.0<xInt) {
-			crossings++;
-		}
-	}
-}
-
-} // namespace geos.algorithm
-} // namespace geos
-
diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am
index b3db843..9c48b02 100644
--- a/tests/unit/Makefile.am
+++ b/tests/unit/Makefile.am
@@ -54,7 +54,6 @@ geos_unit_SOURCES = \
 	algorithm/PointLocatorTest.cpp \
 	algorithm/RobustLineIntersectionTest.cpp \
 	algorithm/RobustLineIntersectorTest.cpp \
-	algorithm/SIRtreePointInRingTest.cpp \
 	geom/CoordinateArraySequenceFactoryTest.cpp \
 	geom/CoordinateArraySequenceTest.cpp \
 	geom/CoordinateListTest.cpp \
diff --git a/tests/unit/algorithm/SIRtreePointInRingTest.cpp b/tests/unit/algorithm/SIRtreePointInRingTest.cpp
deleted file mode 100644
index 2ec04c5..0000000
--- a/tests/unit/algorithm/SIRtreePointInRingTest.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// Test Suite for geos::algorithm::SIRtreePointInRing
-
-#include <tut/tut.hpp>
-// geos
-#include <geos/geom/Coordinate.h>
-#include <geos/algorithm/SIRtreePointInRing.h>
-#include <geos/io/WKTReader.h>
-#include <geos/geom/Geometry.h>
-#include <geos/geom/LinearRing.h>
-// std
-#include <sstream>
-#include <string>
-#include <memory>
-
-namespace tut
-{
-    //
-    // Test Group
-    //
-
-    // dummy data, not used
-    struct test_sirtreepointinring_data {
-        using SIRtreePointInRing = geos::algorithm::SIRtreePointInRing;
-        using Geometry = geos::geom::Geometry;
-        using Coordinate = geos::geom::Coordinate;
-
-        geos::io::WKTReader reader;
-        std::unique_ptr<Geometry> geom;
-    };
-
-    typedef test_group<test_sirtreepointinring_data> group;
-    typedef group::object object;
-
-    group test_sirtreepointinring_data("geos::algorithm::SIRtreePointInRing");
-
-    //
-    // Test Cases
-    //
-
-    template<>
-    template<>
-    void object::test<1>()
-    {
-        using geos::geom::LinearRing;
-        geom.reset(reader.read("LINEARRING (0 0, 1 0, 1 1, 0 1, 0 0)"));
-
-        SIRtreePointInRing pir{dynamic_cast<LinearRing*>(geom.get())};
-
-        Coordinate c{0.5, 0.5};
-
-        ensure(pir.isInside(c));
-    }
-
-} // namespace tut
-

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

Summary of changes:
 include/geos/algorithm/Makefile.am              |   5 +-
 include/geos/algorithm/SIRtreePointInRing.h     |  60 -------------
 include/geos/geosAlgorithm.h                    |   3 -
 src/Makefile.vc                                 |   2 -
 src/algorithm/Makefile.am                       |   4 +-
 src/algorithm/SIRtreePointInRing.cpp            | 113 ------------------------
 tests/unit/Makefile.am                          |   1 -
 tests/unit/algorithm/SIRtreePointInRingTest.cpp |  56 ------------
 8 files changed, 2 insertions(+), 242 deletions(-)
 delete mode 100644 include/geos/algorithm/SIRtreePointInRing.h
 delete mode 100644 src/algorithm/SIRtreePointInRing.cpp
 delete mode 100644 tests/unit/algorithm/SIRtreePointInRingTest.cpp


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list