diff options
-rw-r--r-- | fix-suppor_geos36.patch | 94 | ||||
-rw-r--r-- | geos-3_8-support.patch | 69 |
2 files changed, 0 insertions, 163 deletions
diff --git a/fix-suppor_geos36.patch b/fix-suppor_geos36.patch deleted file mode 100644 index 31e3899cb280..000000000000 --- a/fix-suppor_geos36.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 6a3f724e3a19aa53ba7af40bcbce7e1e19477a8e Mon Sep 17 00:00:00 2001 -From: Sandro Mani <manisandro@gmail.com> -Date: Mon, 20 Mar 2017 15:19:09 +0100 -Subject: [PATCH] Add GEOS >= 3.6.0 compatibility - ---- - src/osgEarthSymbology/GEOS | 6 ++++++ - src/osgEarthSymbology/GEOS.cpp | 15 ++++++++++++++- - 2 files changed, 20 insertions(+), 1 deletion(-) - -diff --git a/src/osgEarthSymbology/GEOS b/src/osgEarthSymbology/GEOS -index 9921e65440..74471d2123 100644 ---- a/src/osgEarthSymbology/GEOS -+++ b/src/osgEarthSymbology/GEOS -@@ -25,7 +25,9 @@ - #include <osgEarthFeatures/Common> - #include <osgEarthSymbology/Style> - #include <osgEarthSymbology/Geometry> -+#include <geos/version.h> - #include <geos/geom/Geometry.h> -+#include <geos/geom/GeometryFactory.h> - - namespace osgEarth { namespace Symbology - { -@@ -45,7 +47,11 @@ namespace osgEarth { namespace Symbology - void disposeGeometry(geos::geom::Geometry* input); - - protected: -+#if GEOS_VERSION_MAJOR >= 3 && GEOS_VERSION_MINOR >= 6 -+ geos::geom::GeometryFactory::unique_ptr _factory; -+#else - geos::geom::GeometryFactory* _factory; -+#endif - }; - - } } // namespace osgEarth::Features -diff --git a/src/osgEarthSymbology/GEOS.cpp b/src/osgEarthSymbology/GEOS.cpp -index 9d7d27e521..db42f657ee 100644 ---- a/src/osgEarthSymbology/GEOS.cpp -+++ b/src/osgEarthSymbology/GEOS.cpp -@@ -216,7 +216,11 @@ GEOSContext::GEOSContext() - geos::geom::PrecisionModel* pm = new geos::geom::PrecisionModel(geom::PrecisionModel::FLOATING); - - // Factory will clone the PM -+#if GEOS_VERSION_MAJOR >= 3 && GEOS_VERSION_MINOR >= 6 -+ _factory = geos::geom::GeometryFactory::create( pm ); -+#else - _factory = new geos::geom::GeometryFactory( pm ); -+#endif - - // Delete the template. - delete pm; -@@ -224,7 +228,9 @@ GEOSContext::GEOSContext() - - GEOSContext::~GEOSContext() - { -+#if !(GEOS_VERSION_MAJOR >= 3 && GEOS_VERSION_MINOR >= 6) - delete _factory; -+#endif - } - - geom::Geometry* -@@ -233,12 +239,16 @@ GEOSContext::importGeometry(const Symbology::Geometry* input) - geom::Geometry* output = 0L; - if ( input && input->isValid() ) - { -+#if GEOS_VERSION_MAJOR >= 3 && GEOS_VERSION_MINOR >= 6 -+ output = import( input, _factory.get() ); -+#else - output = import( input, _factory ); - - // if output is ok, it will have a pointer to f. this is probably a leak. - // TODO: Check whether this is a leak!! -gw - //if ( !output ) - // delete f; -+#endif - } - return output; - } -@@ -335,10 +345,13 @@ GEOSContext::disposeGeometry(geom::Geometry* input) - { - if (input) - { -- geom::GeometryFactory* f = const_cast<geom::GeometryFactory*>(input->getFactory()); -+#if GEOS_VERSION_MAJOR >= 3 && GEOS_VERSION_MINOR >= 6 - _factory->destroyGeometry(input); -+#else -+ geom::GeometryFactory* f = const_cast<geom::GeometryFactory*>(input->getFactory()); - if ( f != _factory ) - delete f; -+#endif - } - } - diff --git a/geos-3_8-support.patch b/geos-3_8-support.patch deleted file mode 100644 index 5993d4cb0c85..000000000000 --- a/geos-3_8-support.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -Nur osgearth-osgearth-2.10.2.a/src/osgEarthSymbology/GEOS.cpp osgearth-osgearth-2.10.2.b/src/osgEarthSymbology/GEOS.cpp ---- osgearth-osgearth-2.10.2.a/src/osgEarthSymbology/GEOS.cpp 2019-07-12 08:49:14.000000000 -0700 -+++ osgearth-osgearth-2.10.2.b/src/osgEarthSymbology/GEOS.cpp 2019-11-16 10:00:08.966241888 -0800 -@@ -49,7 +49,7 @@ - - namespace - { -- geom::CoordinateSequence* -+ std::unique_ptr<geom::CoordinateSequence> - vec3dArray2CoordSeq( const Symbology::Geometry* input, bool close, const geom::CoordinateSequenceFactory* factory ) - { - bool needToClose = close && input->size() > 2 && input->front() != input->back(); -@@ -64,7 +64,7 @@ - { - coords->push_back( coords->front() ); - } -- geom::CoordinateSequence* seq = factory->create( coords ); -+ std::unique_ptr<geom::CoordinateSequence> seq = factory->create( coords ); - - return seq; - } -@@ -108,7 +108,8 @@ - else - { - // any other type will at least contain points: -- geom::CoordinateSequence* seq = 0L; -+ std::unique_ptr<geom::CoordinateSequence> seq = 0L; -+ - try - { - switch( input->getType() ) -@@ -119,24 +120,24 @@ - - case Symbology::Geometry::TYPE_POINTSET: - seq = vec3dArray2CoordSeq( input, false, f->getCoordinateSequenceFactory() ); -- if ( seq ) output = f->createPoint( seq ); -+ if ( seq ) output = f->createPoint( *seq ); - break; - - case Symbology::Geometry::TYPE_LINESTRING: - seq = vec3dArray2CoordSeq( input, false, f->getCoordinateSequenceFactory() ); -- if ( seq ) output = f->createLineString( seq ); -+ if ( seq ) output = f->createLineString( *seq ); - break; - - case Symbology::Geometry::TYPE_RING: - seq = vec3dArray2CoordSeq( input, true, f->getCoordinateSequenceFactory() ); -- if ( seq ) output = f->createLinearRing( seq ); -+ if ( seq ) output = f->createLinearRing( *seq ); - break; - - case Symbology::Geometry::TYPE_POLYGON: - seq = vec3dArray2CoordSeq( input, true, f->getCoordinateSequenceFactory() ); - geom::LinearRing* shell = 0L; - if ( seq ) -- shell = f->createLinearRing( seq ); -+ shell = f->createLinearRing( *seq ); - - if ( shell ) - { -@@ -155,7 +156,7 @@ - holes = 0L; - } - } -- output = f->createPolygon( shell, holes ); -+ output = f->createPolygon( shell, (std::vector<geom::LinearRing * >*)holes ); - } - - break; |