Skip to content

Commit 7e3dc30

Browse files
committed
Fix bounding box calculation of geometry collections, fix #4102
1 parent 2794ea1 commit 7e3dc30

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core/geometry/qgsgeometrycollectionv2.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void QgsGeometryCollectionV2::clear()
7272
qDeleteAll( mGeometries );
7373
mGeometries.clear();
7474
mWkbType = QgsWKBTypes::Unknown;
75+
mBoundingBox = QgsRectangle(); //set bounding box invalid
7576
}
7677

7778
int QgsGeometryCollectionV2::numGeometries() const
@@ -105,6 +106,7 @@ bool QgsGeometryCollectionV2::addGeometry( QgsAbstractGeometryV2* g )
105106
}
106107

107108
mGeometries.append( g );
109+
mBoundingBox = QgsRectangle(); //set bounding box invalid
108110
return true;
109111
}
110112

@@ -116,6 +118,7 @@ bool QgsGeometryCollectionV2::insertGeometry( QgsAbstractGeometryV2 *g, int inde
116118
}
117119

118120
mGeometries.insert( index, g );
121+
mBoundingBox = QgsRectangle(); //set bounding box invalid
119122
return true;
120123
}
121124

@@ -127,6 +130,7 @@ bool QgsGeometryCollectionV2::removeGeometry( int nr )
127130
}
128131
delete mGeometries[nr];
129132
mGeometries.remove( nr );
133+
mBoundingBox = QgsRectangle(); //set bounding box invalid
130134
return true;
131135
}
132136

@@ -152,6 +156,7 @@ void QgsGeometryCollectionV2::transform( const QgsCoordinateTransform& ct, QgsCo
152156
{
153157
( *it )->transform( ct, d );
154158
}
159+
mBoundingBox = QgsRectangle(); //set bounding box invalid
155160
}
156161

157162
void QgsGeometryCollectionV2::transform( const QTransform& t )
@@ -161,6 +166,7 @@ void QgsGeometryCollectionV2::transform( const QTransform& t )
161166
{
162167
( *it )->transform( t );
163168
}
169+
mBoundingBox = QgsRectangle(); //set bounding box invalid
164170
}
165171

166172
#if 0
@@ -211,6 +217,7 @@ bool QgsGeometryCollectionV2::fromWkb( const unsigned char * wkb )
211217
{
212218
mGeometries[i] = geometryList.at( i );
213219
}
220+
mBoundingBox = QgsRectangle(); //set bounding box invalid
214221

215222
return true;
216223
}

0 commit comments

Comments
 (0)