Skip to content

Commit

Permalink
Set default value for reach point levels to NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 24, 2019
1 parent 65c8ef5 commit 21d3d8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tools/qgepmaptooladdfeature.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,12 @@ def right_clicked(self, _):
# assign level if the match is a node or if we have 3D from snapping
if match.layer() == self.node_layer:
level = network_element['bottom_level']
level = level if not math.isnan(level) else NULL
f.setAttribute(level_field_index, level)
elif self.rubberband.points[pt_idx].z() != 0:
f.setAttribute(level_field_index, self.rubberband.points[pt_idx].z())
level = self.rubberband.points[pt_idx].z()
level = level if not math.isnan(level) else NULL
f.setAttribute(level_field_index, level)

dlg = self.iface.getFeatureForm(self.layer, f)
dlg.setMode(QgsAttributeEditorContext.AddFeatureMode)
Expand Down

0 comments on commit 21d3d8d

Please sign in to comment.