diff --git a/python/core/qgsgeometry.sip b/python/core/qgsgeometry.sip index ec3f7aa2a02..5545b903b33 100644 --- a/python/core/qgsgeometry.sip +++ b/python/core/qgsgeometry.sip @@ -230,8 +230,10 @@ not disjoint with existing polygons of the feature*/ /** Returns a geometry representing the points shared by this geometry and other. */ QgsGeometry* intersection(QgsGeometry* geometry) /Factory/; - /** Returns a geometry representing all the points in this geometry and other. */ - QgsGeometry* Union(QgsGeometry* geometry) /Factory/; + /** Returns a geometry representing all the points in this geometry and other (a + * union geometry operation). + * @note this operation is not called union since its a reserved word in C++.*/ + QgsGeometry* combine( QgsGeometry* geometry ); /** Returns a geometry representing the points making up this geometry that do not make up other. */ QgsGeometry* difference(QgsGeometry* geometry) /Factory/; diff --git a/src/core/qgsgeometry.cpp b/src/core/qgsgeometry.cpp index 035e9a7015d..8e93aedce7d 100644 --- a/src/core/qgsgeometry.cpp +++ b/src/core/qgsgeometry.cpp @@ -5347,7 +5347,7 @@ QgsGeometry* QgsGeometry::intersection( QgsGeometry* geometry ) CATCH_GEOS( 0 ) } -QgsGeometry* QgsGeometry::Union( QgsGeometry* geometry ) +QgsGeometry* QgsGeometry::combine( QgsGeometry* geometry ) { if ( geometry == NULL ) { diff --git a/src/core/qgsgeometry.h b/src/core/qgsgeometry.h index 5133bdbde50..aaa544d5260 100644 --- a/src/core/qgsgeometry.h +++ b/src/core/qgsgeometry.h @@ -276,8 +276,10 @@ class CORE_EXPORT QgsGeometry /** Returns a geometry representing the points shared by this geometry and other. */ QgsGeometry* intersection( QgsGeometry* geometry ); - /** Returns a geometry representing all the points in this geometry and other. */ - QgsGeometry* Union( QgsGeometry* geometry ); + /** Returns a geometry representing all the points in this geometry and other (a + * union geometry operation). + * @note this operation is not called union since its a reserved word in C++.*/ + QgsGeometry* combine( QgsGeometry* geometry ); /** Returns a geometry representing the points making up this geometry that do not make up other. */ QgsGeometry* difference( QgsGeometry* geometry ); diff --git a/tests/src/core/testqgsgeometry.cpp b/tests/src/core/testqgsgeometry.cpp index c436d7c6de9..e50da0873f0 100644 --- a/tests/src/core/testqgsgeometry.cpp +++ b/tests/src/core/testqgsgeometry.cpp @@ -227,7 +227,7 @@ void TestQgsGeometry::intersectionCheck2() void TestQgsGeometry::unionCheck1() { // should be a multipolygon with 2 parts as A does not intersect C - QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->Union( mpPolygonGeometryC ); + QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->combine( mpPolygonGeometryC ); qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() ); QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBMultiPolygon ); QgsMultiPolygon myMultiPolygon = mypUnionGeometry->asMultiPolygon(); @@ -240,7 +240,7 @@ void TestQgsGeometry::unionCheck1() void TestQgsGeometry::unionCheck2() { // should be a single polygon as A intersect B - QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->Union( mpPolygonGeometryB ); + QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->combine( mpPolygonGeometryB ); qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() ); QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBPolygon ); QgsPolygon myPolygon = mypUnionGeometry->asPolygon();