Skip to content

QEP 322: Point layer edition from the profile tool #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions qep-322-profile-tool-point-edition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# QGIS Enhancement 322: Add support for point layer edition from the profile tool

**Date** 2025/02/13

**Author** Jean Felder (@ptitjano), Jacky Volpes (@Djedouas)

**Contact** jean dot felder at oslandia dot com, jacky dot volpes at oslandia dot com

**Version** QGIS 3.44

# Summary

This proposal aims to enable the editing of point layers directly from the elevation profile. It will be possible to add new points, move existing ones, and delete them. Additionally, selecting points from the elevation profile will be possible. Editing directly within the elevation profile will make it easier to precisely adjust the elevation of 3D points.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would deletion work? Would it work on selection, or be a "click on points to delete" tool? If the latter, is it click per individual point? or marquee based?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be selection based. I have added some text to explain it.


## Proposed Solution

The main challenge of this feature is ensuring that these new functionalities do not conflict with the existing editing options in the main canvas. To make the solution as clear as possible, we propose to:

- Add a new editing section to the toolbar within the elevation profile panel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the same reasons as the pushback against the editing tools in the 3d window toolbar, can we avoid just dumping all these actions into the existing profile window toolbar? We need an alternative approach which doesn't add extra UI complexity (and minimum horizontal window size requirement).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is probably the most controversial part of this proposal.

However, we did some user testing and this is only approach that made sense for them. Indeed, when using this feature, they need to open to open several elevation profile widget. From their point of view, each widget is a standalone application. Thus, it needs their own buttons.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, we did some user testing and this is only approach that made sense for them. Indeed, when using this feature, they need to open to open several elevation profile widget. From their point of view, each widget is a standalone application. Thus, it needs their own buttons.

We still need some alternative vs just chucking them in the toolbar. It could be an additional (hidden by default) toolbar in the profile window, or a drop-down menu with edit actions, or some initially invisible panel. But I'm -1 to what you've described here.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for the "per-profile" toolbar ... profile "layer tree view" is NOT synced with the main one !

The main problem happens when you select the layer you wanna edit in the profile window, and the "toogle editing" button of the main window ... toogles the main window current layer (which is NOT the one you selected in your profile). This is really enoying at use, since whenever you want to edit something in your profile you have to go back to the main window (exit dual screen ergonomy).

The "feel good" behavior is edit what you select ... in your current/active widget

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@T4mmi that's not my issue though -- my issue is with adding 7 more icons to the elevation profile toolbar, and the associated UI complexity/bloat. I think at a minimum these should be hidden by default, and only shown if the user opts-in via eg a "Show Editing Tools" toggle in the profile settings drop-down menu.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hiding icons as default is fine when the setting can be toggled.

- Display the editing icon for the layer currently selected in the elevation profile tree view.
- Synchronize edition state between the main canvas and the elevation profile: enabling edition on a layer from the elevation profile will activate it in the main canvas, and vice versa.
- Synchronize selection: it is the same between the elevation plots and the main layer.

The different operations (Add, Delete, Move, Select) will be implemented by creating new tools that inherit from `QgsPlotTool`.

This editing toolbox will not be enabled if the selected layer is not a point layer.

### Selection

Select features by clicking on them or with a rectangle selection. keyboard modifiers will allow to select points more precisely:

- Shift to add to current selection
- Control to remove from current selection

### Add features

In editing mode, activate it by clicking the "Add Point Feature" button in the elevation profile panel. then click on the elevation profile to add a new point. If necessary, the attribute form will immediately open. Snapping will be handled.

### Move features

In editing mode, activate it by clicking the "Move Points Feature" button in the elevation profile panel. Select a point by clicking on it and then click on its new location. Moving points will have a special "lock abscissa" keyboard modifier to avoid changing x/y coordinate while moving. It will also handle snapping.

### Delete features

Deletion of features will work on selection. First, select features by clicking on them or using a rectangle selection. Then delete them by clicking the "Delete Features" button from the elevation profile toolbar.
Comment on lines +43 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I don't see any need for a special delete features tool in the elevation profile -- there's barely any difference vs doing the selection in the profile and then hitting delete on the main window toolbar.

Copy link

@Jakob-Lanstorp Jakob-Lanstorp Feb 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the elevation profile should have Toggle Editing, Add point, Move point and Delete point buttons. This might seem redundant to the main window, but nevertheless, this is a common design also between the the main window and a the Attribute window with several common buttons.

If working 2 screens with elevation profile in one window, there might be a long distance across multiple screens to the main window.

Copy link

@T4mmi T4mmi Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for the "per-profile" tools ... even if its a hidden by default one.

Working in a profile view is a specific work where we wanna manipulate points individually (contrary to drape for example) and without going back and forth to the main window.


### Tolerance

- added points will be placed on the profile line
- points can be picked/selected in the tolerance zone to be moved or deleted but moved points are reprojected on the profile line (x/y are changed when z is moved)

## Deliverables

- A new editing toolbox in the profile tool
- Add / Move / Delete / Select points from the profile tool

This branch already contains a rough implementation: https://github.com/ptitjano/QGIS/tree/capture-profile-points

### Affected Files

- src/app/elevation/qgselevationprofilewidget.{h,cpp}
- src/app/elevation/qgselevationprofiletooladdpoint.{h,cpp} (new files)
- src/app/elevation/qgselevationprofiletoolmovepoint.{h,cpp} (new files)
- src/app/elevation/qgselevationprofiletoolselectfeatures.{h,cpp} (new files)
- src/core/elevation/qgsprofilerenderer.cpp
- src/core/layout/qgslayoutitemelevationprofile.cpp
- src/gui/elevation/qgselevationprofilelayertreeview.cpp
- src/gui/elevation/qgselevationprofilecanvas.cpp
- src/gui/plot/qgsplotrubberband.{h,cpp} (new files)

## Risks

Increased complexity and maintenance burden in the profile tool code.

## Performance Implications

N/A

## Backwards Compatibility

Not Applicable.


Funded by: BRGM