Skip to content
Permalink
Browse files

Rename QgsGeometry::fromPoint to QgsGeometry::fromPointXY

Also introduces the from[Geometry]XY for QgsGeometryFactory
  • Loading branch information
m-kuhn committed Oct 30, 2017
1 parent 82e6d12 commit e0025b65b1cb80b0f571c561c099bfee623de4d3
Showing with 198 additions and 198 deletions.
  1. +1 −1 python/core/geometry/qgsgeometry.sip
  2. +1 −1 python/plugins/processing/algs/qgis/CheckValidity.py
  3. +1 −1 python/plugins/processing/algs/qgis/HubDistancePoints.py
  4. +1 −1 python/plugins/processing/algs/qgis/PointsFromLines.py
  5. +1 −1 python/plugins/processing/algs/qgis/RandomPointsAlongLines.py
  6. +1 −1 python/plugins/processing/algs/qgis/RandomPointsExtent.py
  7. +1 −1 python/plugins/processing/algs/qgis/RandomPointsLayer.py
  8. +1 −1 python/plugins/processing/algs/qgis/RandomPointsPolygons.py
  9. +2 −2 python/plugins/processing/algs/qgis/RegularPoints.py
  10. +1 −1 src/analysis/processing/qgsalgorithmlineintersection.cpp
  11. +1 −1 src/analysis/processing/qgsalgorithmmeancoordinates.cpp
  12. +1 −1 src/app/nodetool/qgsnodeeditor.cpp
  13. +1 −1 src/app/nodetool/qgsnodetool.cpp
  14. +2 −2 src/app/qgsmaptooladdfeature.cpp
  15. +2 −2 src/app/qgsmaptooldeletepart.cpp
  16. +1 −1 src/app/qgsmaptoollabel.cpp
  17. +1 −1 src/app/qgsmaptoolmovefeature.cpp
  18. +1 −1 src/app/qgsmaptoolrotatefeature.cpp
  19. +1 −1 src/app/qgsmaptoolsimplify.cpp
  20. +1 −1 src/core/composer/qgscomposermap.cpp
  21. +4 −4 src/core/geometry/qgsgeometry.cpp
  22. +1 −1 src/core/geometry/qgsgeometry.h
  23. +3 −3 src/core/geometry/qgsgeometryfactory.cpp
  24. +2 −2 src/core/geometry/qgsgeometryfactory.h
  25. +1 −1 src/core/qgsexpressioncontext.cpp
  26. +1 −1 src/core/qgspointlocator.cpp
  27. +6 −6 src/plugins/topology/topolTest.cpp
  28. +1 −1 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.cpp
  29. +1 −1 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  30. +1 −1 src/providers/grass/qgis.v.in.cpp
  31. +1 −1 tests/src/app/testqgsnodetool.cpp
  32. +20 −20 tests/src/core/testqgsexpression.cpp
  33. +3 −3 tests/src/core/testqgsgeometry.cpp
  34. +2 −2 tests/src/core/testqgslabelingengine.cpp
  35. +7 −7 tests/src/core/testqgslegendrenderer.cpp
  36. +1 −1 tests/src/core/testqgsogcutils.cpp
  37. +3 −3 tests/src/core/testqgsspatialindex.cpp
  38. +2 −2 tests/src/core/testqgsvectorfilewriter.cpp
  39. +4 −4 tests/src/python/offlineditingtestbase.py
  40. +3 −3 tests/src/python/test_provider_memory.py
  41. +2 −2 tests/src/python/test_qgsatlascomposition.py
  42. +2 −2 tests/src/python/test_qgsattributetablemodel.py
  43. +1 −1 tests/src/python/test_qgseditwidgets.py
  44. +2 −2 tests/src/python/test_qgsfeature.py
  45. +8 −8 tests/src/python/test_qgsfeaturesink.py
  46. +5 −5 tests/src/python/test_qgsfeaturesource.py
  47. +12 −12 tests/src/python/test_qgsgeometry.py
  48. +1 −1 tests/src/python/test_qgsgraduatedsymbolrenderer.py
  49. +1 −1 tests/src/python/test_qgsmapcanvasannotationitem.py
  50. +1 −1 tests/src/python/test_qgsmaprenderer.py
  51. +1 −1 tests/src/python/test_qgsrangewidgets.py
  52. +6 −6 tests/src/python/test_qgsrelation.py
  53. +2 −2 tests/src/python/test_qgsrenderer.py
  54. +7 −7 tests/src/python/test_qgsserver_wfst.py
  55. +1 −1 tests/src/python/test_qgsspatialindex.py
  56. +1 −1 tests/src/python/test_qgssymbollayer_readsld.py
  57. +3 −3 tests/src/python/test_qgsvectorfilewriter.py
  58. +1 −1 tests/src/python/test_qgsvectorfilewritertask.py
  59. +35 −35 tests/src/python/test_qgsvectorlayer.py
  60. +15 −15 tests/src/python/test_qgsvectorlayereditbuffer.py
  61. +1 −1 tests/src/python/test_qgsvectorlayerutils.py
@@ -145,7 +145,7 @@ Copy constructor will prompt a deep copy of the object
Creates a new geometry from a WKT string
:rtype: QgsGeometry
%End
static QgsGeometry fromPoint( const QgsPointXY &point );
static QgsGeometry fromPointXY( const QgsPointXY &point );
%Docstring
Creates a new geometry from a QgsPointXY object
:rtype: QgsGeometry
@@ -152,7 +152,7 @@ def doCheck(self, method, parameters, context, feedback):
reasons = []
for error in errors:
errFeat = QgsFeature()
error_geom = QgsGeometry.fromPoint(error.where())
error_geom = QgsGeometry.fromPointXY(error.where())
errFeat.setGeometry(error_geom)
errFeat.setAttributes([error.what()])
if error_output_sink:
@@ -144,7 +144,7 @@ def processAlgorithm(self, parameters, context, feedback):
feat = QgsFeature()
feat.setAttributes(attributes)

feat.setGeometry(QgsGeometry.fromPoint(src))
feat.setGeometry(QgsGeometry.fromPointXY(src))

sink.addFeature(feat, QgsFeatureSink.FastInsert)
feedback.setProgress(int(current * total))
@@ -192,7 +192,7 @@ def buildLine(self, startX, startY, endX, endY, geoTransform, writer, feature):
def createPoint(self, pX, pY, geoTransform, writer, feature):
(x, y) = raster.pixelToMap(pX, pY, geoTransform)

feature.setGeometry(QgsGeometry.fromPoint(QgsPointXY(x, y)))
feature.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(x, y)))
feature['id'] = self.fid
feature['line_id'] = self.lineId
feature['point_id'] = self.pointId
@@ -148,7 +148,7 @@ def processAlgorithm(self, parameters, context, feedback):

# generate random point
p = QgsPointXY(rx, ry)
geom = QgsGeometry.fromPoint(p)
geom = QgsGeometry.fromPointXY(p)
if vector.checkMinDistance(p, index, minDistance, points):
f = QgsFeature(nPoints)
f.initAttributes(1)
@@ -125,7 +125,7 @@ def processAlgorithm(self, parameters, context, feedback):
ry = bbox.yMinimum() + bbox.height() * random.random()

p = QgsPointXY(rx, ry)
geom = QgsGeometry.fromPoint(p)
geom = QgsGeometry.fromPointXY(p)
if geom.within(extent) and \
vector.checkMinDistance(p, index, minDistance, points):
f = QgsFeature(nPoints)
@@ -122,7 +122,7 @@ def processAlgorithm(self, parameters, context, feedback):
ry = bbox.yMinimum() + bbox.height() * random.random()

p = QgsPointXY(rx, ry)
geom = QgsGeometry.fromPoint(p)
geom = QgsGeometry.fromPointXY(p)
ids = sourceIndex.intersects(geom.buffer(5, 5).boundingBox())
if len(ids) > 0 and \
vector.checkMinDistance(p, index, minDistance, points):
@@ -168,7 +168,7 @@ def processAlgorithm(self, parameters, context, feedback):
ry = bbox.yMinimum() + bbox.height() * random.random()

p = QgsPointXY(rx, ry)
geom = QgsGeometry.fromPoint(p)
geom = QgsGeometry.fromPointXY(p)
if geom.within(fGeom) and \
vector.checkMinDistance(p, index, minDistance, points):
f = QgsFeature(nPoints)
@@ -134,11 +134,11 @@ def processAlgorithm(self, parameters, context, feedback):
break

if randomize:
geom = QgsGeometry().fromPoint(QgsPointXY(
geom = QgsGeometry().fromPointXY(QgsPointXY(
uniform(x - (pSpacing / 2.0), x + (pSpacing / 2.0)),
uniform(y - (pSpacing / 2.0), y + (pSpacing / 2.0))))
else:
geom = QgsGeometry().fromPoint(QgsPointXY(x, y))
geom = QgsGeometry().fromPointXY(QgsPointXY(x, y))

if extent_engine.intersects(geom.constGet()):
f.setAttribute('id', count)
@@ -204,7 +204,7 @@ QVariantMap QgsLineIntersectionAlgorithm::processAlgorithm( const QVariantMap &p

for ( const QgsPointXY &j : qgis::as_const( points ) )
{
outFeature.setGeometry( QgsGeometry::fromPoint( j ) );
outFeature.setGeometry( QgsGeometry::fromPointXY( j ) );
outFeature.setAttributes( outAttributes );
sink->addFeature( outFeature, QgsFeatureSink::FastInsert );
}
@@ -196,7 +196,7 @@ QVariantMap QgsMeanCoordinatesAlgorithm::processAlgorithm( const QVariantMap &pa
double cy = it.value().at( 1 ) / it.value().at( 2 );

QgsPointXY meanPoint( cx, cy );
outFeat.setGeometry( QgsGeometry::fromPoint( meanPoint ) );
outFeat.setGeometry( QgsGeometry::fromPointXY( meanPoint ) );

QgsAttributes attributes;
attributes << cx << cy;
@@ -373,7 +373,7 @@ void QgsNodeEditor::zoomToNode( int idx )
//close polygon
ext.append( ext.first() );
QgsGeometry extGeom( QgsGeometry::fromQPolygonF( ext ) );
QgsGeometry nodeGeom( QgsGeometry::fromPoint( tCenter ) );
QgsGeometry nodeGeom( QgsGeometry::fromPointXY( tCenter ) );
if ( !nodeGeom.within( extGeom ) )
{
mCanvas->setCenter( tCenter );
@@ -827,7 +827,7 @@ void QgsNodeTool::updateVertexBand( const QgsPointLocator::Match &m )
{
if ( m.hasVertex() && m.layer() )
{
mVertexBand->setToGeometry( QgsGeometry::fromPoint( m.point() ), nullptr );
mVertexBand->setToGeometry( QgsGeometry::fromPointXY( m.point() ), nullptr );
mVertexBand->setVisible( true );
bool isCircular = false;
if ( m.layer() )
@@ -152,7 +152,7 @@ void QgsMapToolAddFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
QgsGeometry g;
if ( layerWKBType == QgsWkbTypes::Point )
{
g = QgsGeometry::fromPoint( savePoint );
g = QgsGeometry::fromPointXY( savePoint );
}
else if ( layerWKBType == QgsWkbTypes::Point25D )
{
@@ -171,7 +171,7 @@ void QgsMapToolAddFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
else
{
// if layer supports more types (mCheckGeometryType is false)
g = QgsGeometry::fromPoint( savePoint );
g = QgsGeometry::fromPointXY( savePoint );
}

f.setGeometry( g );
@@ -135,13 +135,13 @@ QgsGeometry QgsMapToolDeletePart::partUnderPoint( QPoint point, QgsFeatureId &fi
if ( !g.isMultipart() )
{
fid = match.featureId();
return QgsGeometry::fromPoint( match.point() );
return QgsGeometry::fromPointXY( match.point() );
}
if ( g.wkbType() == QgsWkbTypes::MultiPoint || g.wkbType() == QgsWkbTypes::MultiPoint25D )
{
fid = match.featureId();
partNum = snapVertex;
return QgsGeometry::fromPoint( match.point() );
return QgsGeometry::fromPointXY( match.point() );
}
if ( g.wkbType() == QgsWkbTypes::MultiLineString || g.wkbType() == QgsWkbTypes::MultiLineString25D )
{
@@ -111,7 +111,7 @@ void QgsMapToolLabel::createRubberBands()
fixPoint = s.mapToLayerCoordinates( vlayer, fixPoint );
}

QgsGeometry pointGeom = QgsGeometry::fromPoint( fixPoint );
QgsGeometry pointGeom = QgsGeometry::fromPointXY( fixPoint );
mFixPointRubberBand = new QgsRubberBand( mCanvas, QgsWkbTypes::LineGeometry );
mFixPointRubberBand->setColor( QColor( 0, 0, 255, 65 ) );
mFixPointRubberBand->setToGeometry( pointGeom, vlayer );
@@ -84,7 +84,7 @@ void QgsMapToolMoveFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFilterRect( selectRect ).setSubsetOfAttributes( QgsAttributeList() ) );

//find the closest feature
QgsGeometry pointGeometry = QgsGeometry::fromPoint( layerCoords );
QgsGeometry pointGeometry = QgsGeometry::fromPointXY( layerCoords );
if ( pointGeometry.isNull() )
{
cadDockWidget()->clear();
@@ -221,7 +221,7 @@ void QgsMapToolRotateFeature::canvasReleaseEvent( QgsMapMouseEvent *e )
QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFilterRect( selectRect ).setSubsetOfAttributes( QgsAttributeList() ) );

//find the closest feature
QgsGeometry pointGeometry = QgsGeometry::fromPoint( layerCoords );
QgsGeometry pointGeometry = QgsGeometry::fromPointXY( layerCoords );
if ( pointGeometry.isNull() )
{
return;
@@ -298,7 +298,7 @@ void QgsMapToolSimplify::selectOneFeature( QPoint canvasPoint )
layerCoords.x() + r, layerCoords.y() + r );
QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFilterRect( selectRect ).setSubsetOfAttributes( QgsAttributeList() ) );

QgsGeometry geometry = QgsGeometry::fromPoint( layerCoords );
QgsGeometry geometry = QgsGeometry::fromPointXY( layerCoords );
double minDistance = DBL_MAX;
double currentDistance;
QgsFeature minDistanceFeature;
@@ -1728,7 +1728,7 @@ QgsExpressionContext QgsComposerMap::createExpressionContext() const
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent" ), QVariant::fromValue( QgsGeometry::fromRect( extent ) ), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent_width" ), extent.width(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent_height" ), extent.height(), true ) );
QgsGeometry centerPoint = QgsGeometry::fromPoint( extent.center() );
QgsGeometry centerPoint = QgsGeometry::fromPointXY( extent.center() );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent_center" ), QVariant::fromValue( centerPoint ), true ) );

if ( mComposition )
@@ -156,9 +156,9 @@ QgsGeometry QgsGeometry::fromWkt( const QString &wkt )
return QgsGeometry( std::move( geom ) );
}

QgsGeometry QgsGeometry::fromPoint( const QgsPointXY &point )
QgsGeometry QgsGeometry::fromPointXY( const QgsPointXY &point )
{
std::unique_ptr< QgsAbstractGeometry > geom( QgsGeometryFactory::fromPoint( point ) );
std::unique_ptr< QgsAbstractGeometry > geom( QgsGeometryFactory::fromPointXY( point ) );
if ( geom )
{
return QgsGeometry( geom.release() );
@@ -168,7 +168,7 @@ QgsGeometry QgsGeometry::fromPoint( const QgsPointXY &point )

QgsGeometry QgsGeometry::fromPolylineXY( const QgsPolylineXY &polyline )
{
std::unique_ptr< QgsAbstractGeometry > geom = QgsGeometryFactory::fromPolyline( polyline );
std::unique_ptr< QgsAbstractGeometry > geom = QgsGeometryFactory::fromPolylineXY( polyline );
if ( geom )
{
return QgsGeometry( std::move( geom ) );
@@ -2813,7 +2813,7 @@ QgsGeometry QgsGeometry::convertToPoint( bool destMultipart ) const
QgsMultiPointXY multiPoint = asMultiPoint();
if ( multiPoint.count() == 1 )
{
return fromPoint( multiPoint[0] );
return fromPointXY( multiPoint[0] );
}
}
return QgsGeometry();
@@ -213,7 +213,7 @@ class CORE_EXPORT QgsGeometry
//! Creates a new geometry from a WKT string
static QgsGeometry fromWkt( const QString &wkt );
//! Creates a new geometry from a QgsPointXY object
static QgsGeometry fromPoint( const QgsPointXY &point );
static QgsGeometry fromPointXY( const QgsPointXY &point );
//! Creates a new geometry from a QgsMultiPointXY object
static QgsGeometry fromMultiPointXY( const QgsMultiPointXY &multipoint );

@@ -132,7 +132,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeometryFactory::geomFromWkt( const QStr
return geom;
}

std::unique_ptr< QgsAbstractGeometry > QgsGeometryFactory::fromPoint( const QgsPointXY &point )
std::unique_ptr< QgsAbstractGeometry > QgsGeometryFactory::fromPointXY( const QgsPointXY &point )
{
return qgis::make_unique< QgsPoint >( point.x(), point.y() );
}
@@ -149,7 +149,7 @@ std::unique_ptr<QgsMultiPoint> QgsGeometryFactory::fromMultiPointXY( const QgsMu
return mp;
}

std::unique_ptr<QgsAbstractGeometry> QgsGeometryFactory::fromPolyline( const QgsPolylineXY &polyline )
std::unique_ptr<QgsAbstractGeometry> QgsGeometryFactory::fromPolylineXY( const QgsPolylineXY &polyline )
{
return linestringFromPolyline( polyline );
}
@@ -159,7 +159,7 @@ std::unique_ptr<QgsMultiLineString> QgsGeometryFactory::fromMultiPolylineXY( con
std::unique_ptr< QgsMultiLineString > mLine = qgis::make_unique< QgsMultiLineString >();
for ( int i = 0; i < multiline.size(); ++i )
{
mLine->addGeometry( fromPolyline( multiline.at( i ) ).release() );
mLine->addGeometry( fromPolylineXY( multiline.at( i ) ).release() );
}
return mLine;
}
@@ -65,11 +65,11 @@ class CORE_EXPORT QgsGeometryFactory
static std::unique_ptr< QgsAbstractGeometry > geomFromWkt( const QString &text );

//! Construct geometry from a point
static std::unique_ptr< QgsAbstractGeometry > fromPoint( const QgsPointXY &point );
static std::unique_ptr< QgsAbstractGeometry > fromPointXY( const QgsPointXY &point );
//! Construct geometry from a multipoint
static std::unique_ptr<QgsMultiPoint> fromMultiPointXY( const QgsMultiPointXY &multipoint );
//! Construct geometry from a polyline
static std::unique_ptr< QgsAbstractGeometry > fromPolyline( const QgsPolylineXY &polyline );
static std::unique_ptr< QgsAbstractGeometry > fromPolylineXY( const QgsPolylineXY &polyline );
//! Construct geometry from a multipolyline
static std::unique_ptr<QgsMultiLineString> fromMultiPolylineXY( const QgsMultiPolylineXY &multiline );
//! Construct geometry from a polygon
@@ -921,7 +921,7 @@ QgsExpressionContextScope *QgsExpressionContextUtils::mapSettingsScope( const Qg
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent" ), QVariant::fromValue( extent ), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent_width" ), mapSettings.visibleExtent().width(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent_height" ), mapSettings.visibleExtent().height(), true ) );
QgsGeometry centerPoint = QgsGeometry::fromPoint( mapSettings.visibleExtent().center() );
QgsGeometry centerPoint = QgsGeometry::fromPointXY( mapSettings.visibleExtent().center() );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_extent_center" ), QVariant::fromValue( centerPoint ), true ) );

scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs" ), mapSettings.destinationCrs().authid(), true ) );
@@ -194,7 +194,7 @@ class QgsPointLocator_VisitorArea : public IVisitor
QgsPointLocator_VisitorArea( QgsPointLocator *pl, const QgsPointXY &origPt, QgsPointLocator::MatchList &list )
: mLocator( pl )
, mList( list )
, mGeomPt( QgsGeometry::fromPoint( origPt ) )
, mGeomPt( QgsGeometry::fromPointXY( origPt ) )
{}

void visitNode( const INode &n ) override { Q_UNUSED( n ); }
@@ -321,7 +321,7 @@ ErrorList topolTest::checkDanglingLines( double tolerance, QgsVectorLayer *layer
if ( repetitions == 1 )
{

QgsGeometry conflictGeom = QgsGeometry::fromPoint( p );
QgsGeometry conflictGeom = QgsGeometry::fromPointXY( p );
if ( isExtent )
{
if ( canvasExtentPoly.disjoint( conflictGeom ) )
@@ -807,7 +807,7 @@ ErrorList topolTest::checkPseudos( double tolerance, QgsVectorLayer *layer1, Qgs

if ( repetitions == 2 )
{
QgsGeometry conflictGeom = QgsGeometry::fromPoint( p );
QgsGeometry conflictGeom = QgsGeometry::fromPointXY( p );

if ( isExtent )
{
@@ -1253,8 +1253,8 @@ ErrorList topolTest::checkPointCoveredByLineEnds( double tolerance, QgsVectorLay
continue;
}
QgsPolylineXY g2Line = g2.asPolyline();
QgsGeometry startPoint = QgsGeometry::fromPoint( g2Line.at( 0 ) );
QgsGeometry endPoint = QgsGeometry::fromPoint( g2Line.last() );
QgsGeometry startPoint = QgsGeometry::fromPointXY( g2Line.at( 0 ) );
QgsGeometry endPoint = QgsGeometry::fromPointXY( g2Line.last() );
touched = g1.intersects( startPoint ) || g1.intersects( endPoint );

if ( touched )
@@ -1316,8 +1316,8 @@ ErrorList topolTest::checkyLineEndsCoveredByPoints( double tolerance, QgsVectorL
QgsGeometry g1 = it->feature.geometry();

QgsPolylineXY g1Polyline = g1.asPolyline();
QgsGeometry startPoint = QgsGeometry::fromPoint( g1Polyline.at( 0 ) );
QgsGeometry endPoint = QgsGeometry::fromPoint( g1Polyline.last() );
QgsGeometry startPoint = QgsGeometry::fromPointXY( g1Polyline.at( 0 ) );
QgsGeometry endPoint = QgsGeometry::fromPointXY( g1Polyline.last() );

QgsRectangle bb = g1.boundingBox();
QList<QgsFeatureId> crossingIds;
@@ -436,7 +436,7 @@ QgsGeometry QgsDelimitedTextFeatureIterator::loadGeometryXY( const QStringList &

if ( ok && wantGeometry( pt ) )
{
return QgsGeometry::fromPoint( pt );
return QgsGeometry::fromPointXY( pt );
}
return QgsGeometry();
}
@@ -514,7 +514,7 @@ void QgsDelimitedTextProvider::scanFile( bool buildIndexes )
{
QgsFeature f;
f.setId( mFile->recordId() );
f.setGeometry( QgsGeometry::fromPoint( pt ) );
f.setGeometry( QgsGeometry::fromPointXY( pt ) );
mSpatialIndex->insertFeature( f );
}
}
@@ -393,7 +393,7 @@ int main( int argc, char **argv )
}
QgsPointXY point( x, y );
QgsFeature feature( area );
feature.setGeometry( QgsGeometry::fromPoint( point ) );
feature.setGeometry( QgsGeometry::fromPointXY( point ) );
feature.setValid( true );
centroids.insert( area, feature );
spatialIndex.insertFeature( feature );
@@ -162,7 +162,7 @@ void TestQgsNodeTool::initTestCase()
polygonF1.setGeometry( QgsGeometry::fromPolygonXY( polygon1 ) );

QgsFeature pointF1;
pointF1.setGeometry( QgsGeometry::fromPoint( QgsPointXY( 2, 3 ) ) );
pointF1.setGeometry( QgsGeometry::fromPointXY( QgsPointXY( 2, 3 ) ) );

mLayerLine->startEditing();
mLayerLine->addFeature( lineF1 );

0 comments on commit e0025b6

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