Skip to content
Permalink
Browse files

Fix multisurface allowing insertion of non surface geometries

  • Loading branch information
nyalldawson committed Sep 26, 2017
1 parent 4d989f8 commit 5ed6605225b43147aa34d452038ac42d289fa772
@@ -38,6 +38,8 @@ class QgsMultiSurface: QgsGeometryCollection

virtual bool addGeometry( QgsAbstractGeometry *g /Transfer/ );

virtual bool insertGeometry( QgsAbstractGeometry *g /Transfer/, int index );

virtual QgsAbstractGeometry *boundary() const /Factory/;


@@ -162,6 +162,17 @@ bool QgsMultiSurface::addGeometry( QgsAbstractGeometry *g )
return QgsGeometryCollection::addGeometry( g );
}

bool QgsMultiSurface::insertGeometry( QgsAbstractGeometry *g, int index )
{
if ( !g || !qgsgeometry_cast< QgsSurface * >( g ) )
{
delete g;
return false;
}

return QgsGeometryCollection::insertGeometry( g, index );
}

QgsAbstractGeometry *QgsMultiSurface::boundary() const
{
QgsMultiCurve *multiCurve = new QgsMultiCurve();
@@ -38,6 +38,7 @@ class CORE_EXPORT QgsMultiSurface: public QgsGeometryCollection
QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const override;
QString asJSON( int precision = 17 ) const override;
bool addGeometry( QgsAbstractGeometry *g SIP_TRANSFER ) override;
bool insertGeometry( QgsAbstractGeometry *g SIP_TRANSFER, int index ) override;
QgsAbstractGeometry *boundary() const override SIP_FACTORY;

#ifndef SIP_RUN

0 comments on commit 5ed6605

Please sign in to comment.
You can’t perform that action at this time.