[QGIS-Developer] Vertex tool and cache invalidation

Hugo Mercier hugo.mercier at oslandia.com
Tue Dec 18 00:30:12 PST 2018


Hi,

I am facing some issues with the vertex tool of 3.x.

In 2.18 the "node tool" was working by clicking first on a geometry to
select it or its vertices and then displace them. With the new "vertex
tool", there is no more first click involved and geometries are
"selected" when the mouse position is close enough.

This behaviour and ergonomic change (which I like !) implied an
implementation that needs, for descent performances, to build a cache of
geometries and maintain it.

Problems arise when a modification on a layer may trigger modifications
on others. For example when two layers have triggers in database (to
maintain a correct network topology in database for instance), or even
when the same layer is opened twice.

QGIS has no way to know that the modification of a layer can modify
another layer. So it easily leads to problems where "phantom" geometries
are still selectable but actual (modified by side effect) geometries are
not.

I introduced in a previous version a way to express "data dependencies"
between layers, with this issue in mind. For PostgreSQL databases, there
is probably also a way to circumvent this by using the LISTEN/NOTIFY
mechanism and some lines of Python.
However I find these solutions very obscure and unfriendly.

Open question: what about re-introducing the old "click first" behaviour
of the vertex tool (and probably other tools) in a next version ? Not as
a replacement, but as a possible alternative.


More information about the QGIS-Developer mailing list