Is there a way of establishing the order that a user selected features using QGIS and Python?
By example: we have a network of line features representing a road network, and the user defines a route from point A to point B. Currently, using layer.selectedFeatures() returns the correct features, but in the order they were drawn rather than the order they were selected.
I've tried a few things to do this manually:
- QgsMapToolEmitPoint(canvas) obviously doesn't work - I want the feature not the point clicked. But I guess in worst case I could hack a spatial query to do a look up of the closest feature. Not ideal.
- QgsMapToolSelect(canvas) doesn't seem to be available as part of the Python accessible GUI or CORE, although I can find mention of it existing elsewhere.