linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Create feature geometry Gazetteer tool no longer requires active layer to be selected, also defaults to point geometry #217

Closed CMKMS-LINZ closed 3 years ago

CMKMS-LINZ commented 4 years ago

Bug Description

In production plugin 1.8.1, if no vector layer is selected, then the 'New feature geometries' tool is selected, and somewhere clicked, nothing happens. If any layer in the layer tree other than the Gazetteer feature layers is selected, an error message is thrown up (see test plan 3 step 10).

In plugin 2.0.1 UAT, if either no vector layer, or any random vector layer is selected, and then 'New feature geometries' tool is selected, and somewhere in the map window clicked, it turns on editing for the active layers, defaulting to creating a New Feature point geometry creation at the position.

This difference gives a small risk of inadvertent extra reference points being added to names.

Steps to Reproduce

See above

Desktop

Screenshots

SPlanzer commented 4 years ago

Bug triage for QGIS3 initial release

As pointed out this is a deviation from expected behavior.

Next steps

As a first step, source code is to be reviewed as to understand how this has been introduced and it complexity. A solutions should be tabled

SPlanzer commented 3 years ago

I have altered src code so that the QGIS native actionAddFeature returns errors when no layer or non relevent layer is selected when using the Create feature geometry Gazetteer tool.

As the QGIS3 actionAddFeature API is different than QGIS2 behavior does differ but errors are raised to adds the scenarios when no layer is selected and when the layers is not a Gazetteer feature layer.

Behaviour is now as follows

No layer selected when using the Create feature geometry Gazetteer tool: "Add feature: No active vector layer" info warning is displayed

Non Gazetteer feature layer selected when using the Create feature geometry Gazetteer tool: "Add feature: Layer not editable" info warning is displayed

CMKMS-LINZ commented 3 years ago

If either the layer Gazetteer feature refpt or Gazetteer feature point is selected, in both instances it will let you create new points (the later layer being the relevant one). In both cases in only creates new points under Gazetteer feature point.

This is acceptable - As the database only allows one reference point, presumably it would be more obvious if it were trying to create a second reference point (eg would crash)

It also does seem to hook into QGIS geometry tools, eg, you can use the Gazetteer tool to add geometry to a non gazetteer layer that is editable.