Skip to content
Permalink
Browse files
More topological editing fixes from Marco
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9473 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 10, 2008
1 parent a9a0c89 commit 2fdfed358437dfe8ccecce9162832b41f418145a
Showing with 19 additions and 1 deletion.
  1. +8 −0 src/app/qgsmaptooladdvertex.cpp
  2. +11 −1 src/core/qgsvectorlayer.cpp
@@ -91,6 +91,14 @@ void QgsMapToolAddVertex::canvasReleaseEvent( QMouseEvent * e )

if ( mSnapper.snapToBackgroundLayers( e->pos(), snapResults ) == 0 )
{

//add segment points in case of topological editing
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if ( topologicalEditing )
{
insertSegmentVerticesForSnap( snapResults, vlayer );
}

snappedPointMapCoord = snapPointFromResults( snapResults, e->pos() );
snappedPointLayerCoord = toLayerCoordinates( vlayer, snappedPointMapCoord );

@@ -1906,7 +1906,17 @@ int QgsVectorLayer::addTopologicalPoints( const QgsPoint& p )

QList<QgsSnappingResult> filteredSnapResults; //we filter out the results that are on existing vertices

const double threshold = 0.00000001;
//work with a tolerance because coordinate projection may introduce some rounding
double threshold = 0.0000001;
if(mCRS && mCRS->mapUnits() == QGis::Meters)
{
threshold = 0.001;
}
else if(mCRS && mCRS->mapUnits() == QGis::Feet)
{
threshold = 0.0001;
}


if ( snapWithContext( p, threshold, snapResults, QgsSnapper::SNAP_TO_SEGMENT ) != 0 )
{

0 comments on commit 2fdfed3

Please sign in to comment.