Keep Z/M information when digitizing from a snapped point (fixes #14318)

This commit is contained in:
Hugo Mercier 2016-02-17 14:44:04 +01:00
parent 22b27c5fdc
commit bcded3c2d4

View File

@ -376,13 +376,14 @@ int QgsMapToolCapture::fetchLayerPoint( QgsPointLocator::Match match , QgsPointV
{ {
QgsFeature f; QgsFeature f;
QgsFeatureRequest request; QgsFeatureRequest request;
QgsPoint foundPoint;
request.setFilterFid( match.featureId() ); request.setFilterFid( match.featureId() );
bool fetched = match.layer()->getFeatures( request ).nextFeature( f ); bool fetched = match.layer()->getFeatures( request ).nextFeature( f );
if ( fetched ) if ( fetched )
{ {
foundPoint = f.geometry()->vertexAt( match.vertexIndex() ); QgsVertexId vId;
layerPoint = QgsPointV2( foundPoint.x(), foundPoint.y() ); if ( !f.geometry()->vertexIdFromVertexNr( match.vertexIndex(), vId ) )
return 2;
layerPoint = f.geometry()->geometry()->vertexAt( vId );
return 0; return 0;
} }
else else