Hi Graeme,

QGIS can do what you describe in your example out of the box.
Workflow:
0) copy layer
1) select polygon in layer
2) use the spatial query plugin
 - select source from layer_copy
 - Where the feature intersects
 - reference features of layer (tick 1 selected polygon)
 - apply
3) zoom to selection of layer_copy

If you work with PostGIS you can use the layer's filter to enter any SQL thus restricting the features to those that fit into the filter rule. Then zoom to the layer and you are done. You can load the result of a query against a PostGIS DB as layer into QGIS, too, by using DB manager.
For automation Processing's graphical modeler might be worth looking at.

Of course you can do most things with a plugin that you e.g. connect to a layer action. I am always reluctant to write a plugin for workflows that can be performed using QGIS' standard tools, though. I know users like to klick on a dedicated button and then something is run just the way they (think they) need it, however IMHO the smarter approach is to train the users to do these tasks themselves with the standard tools.

Bernhard

Am 23.02.2017 um 18:48 schrieb SEGGIE Graeme:
I would like to use QGIS as a visual / interactive front to some PostGIS
data and am not sure what the best route to doing so is. Happy to
explore further myself, but wanted to get some input on what needs to be
joined up to get started on building a little process.



Basically, if I wanted to present a map of features and have a button
(like the attribute information one) which a user would click then use
to select features, I want this to run a SQL query which to get related
features for example and highlight them on the map view, possibly pan to
the extent of the newly selected feature set.



Does this sound like a plugin – or would that be taking things too far?



Would the best way for the dynamic layer to be setup, to be a view –
empty except when populated by the query and styled to be dominant over
the full set of features?



As a simple example, say I had a district zone system of polygons and I
wanted a user to be able to click on any polygon, and have all the
neighbouring polygons highlighted, centred and fill the map view as
fully as possible. What would be the best / simplest approach to this?



Graeme





__________ Information from ESET Mail Security, version of virus signature 
database 14988 (20170224) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to