Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Rename QgsGeometry::fromPoint to QgsGeometry::fromPointXY
Also introduces the from[Geometry]XY for QgsGeometryFactory
- Loading branch information
|
@@ -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 ); |
|
|
Oops, something went wrong.