Bug report #21784

@snapping_results gives no 'result' when adding feature to point layer

Added by Samuel Oester about 5 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:Matthias Kuhn
Category:Digitising
Affected QGIS version:3.6.1 Regression?:No
Operating System:MacOS 10.12 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29599

Description

Tried to use the code snippet explained in the qgis user guide as default value:
with_variable( 'first_snapped_point', array_first( @snapping_results ), attribute(
get_feature_by_id(
map_get( @first_snapped_point, 'layer' ), map_get( @first_snapped_point, 'feature_id' )
),
'object_id'
) )

Worked fine if digitizing on line layer (LineStringZM). Did not work when digitizing on point layer (PointZM).

Only tested with the two layers stored in a geopackage on QGIS 3.4.6 and 3.6.1 (MacOS).
Sample project attached should get default values from features sapped on (field 'uuid').

sample_project.zip (11.7 KB) Samuel Oester, 2019-04-07 10:56 PM

Associated revisions

Revision a0f450df
Added by Matthias Kuhn about 5 years ago

Add @snapping_results variable for points

Fix #21784 https://issues.qgis.org/issues/21784

Revision ccf42dfb
Added by Matthias Kuhn about 5 years ago

Add @snapping_results variable for points

Fix #21784 https://issues.qgis.org/issues/21784

Revision a8e51333
Added by Matthias Kuhn about 5 years ago

Add @snapping_results variable for points

Fix #21784 https://issues.qgis.org/issues/21784

History

#1 Updated by Anonymous about 5 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF