Skip to content

Commit

Permalink
Fix Topological editing not working when the data CRS is different fr…
Browse files Browse the repository at this point in the history
…om project CRS. Fixes #29648
  • Loading branch information
lbartoletti authored and nyalldawson committed Feb 11, 2021
1 parent f495d45 commit 16a071a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -98,7 +98,10 @@ void QgsMapToolAddFeature::digitized( const QgsFeature &f )
{
if ( sm.at( i ).layer() )
{
sm.at( i ).layer()->addTopologicalPoints( f.geometry().vertexAt( i ) );
// transform geometry to vlayer crs and add topological point
QgsGeometry geom( f.geometry() );
geom.transform( QgsCoordinateTransform( vlayer->crs(), sm.at( i ).layer()->crs(), sm.at( i ).layer()->transformContext() ) );
sm.at( i ).layer()->addTopologicalPoints( geom.vertexAt( i ) );
}
}
vlayer->addTopologicalPoints( f.geometry() );
Expand Down

0 comments on commit 16a071a

Please sign in to comment.