Skip to content
Permalink
Browse files

Fix multi point allowing insertion of non point geometries

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent 97930d1 commit ba50bf043bbeaa61674d58386dc4bd3ff5d87cf8
@@ -48,6 +48,8 @@ class QgsMultiPointV2: QgsGeometryCollection
Adds a geometry and takes ownership. Returns true in case of success
:rtype: bool
%End
virtual bool insertGeometry( QgsAbstractGeometry *g /Transfer/, int index );


virtual QgsAbstractGeometry *boundary() const /Factory/;

@@ -127,6 +127,14 @@ bool QgsMultiPointV2::addGeometry( QgsAbstractGeometry *g )
return QgsGeometryCollection::addGeometry( g );
}

bool QgsMultiPointV2::insertGeometry( QgsAbstractGeometry *g, int index )
{
if ( !g || QgsWkbTypes::flatType( g->wkbType() ) != QgsWkbTypes::Point )
return false;

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

QgsAbstractGeometry *QgsMultiPointV2::boundary() const
{
return nullptr;
@@ -47,6 +47,7 @@ class CORE_EXPORT QgsMultiPointV2: public QgsGeometryCollection

//! Adds a geometry and takes ownership. Returns true in case of success
bool addGeometry( QgsAbstractGeometry *g SIP_TRANSFER ) override;
bool insertGeometry( QgsAbstractGeometry *g SIP_TRANSFER, int index ) override;

QgsAbstractGeometry *boundary() const override SIP_FACTORY;

0 comments on commit ba50bf0

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