[Qgis-user] Loading filtered database table as temp layer

Richard McDonnell richard.mcdonnell at opw.ie
Tue May 4 01:58:50 PDT 2021


Hi Michael,

To add to Thayer's message.

There is currently no way to do exactly what you are looking for, but, I would suggest the following as an alternative, which is simple enough to follow...



There are three ways to load a filtered layer into QGIS

Firstly, You can load a Layer using SQL Filter using the either the Data Source Manager or DB Manager.

1.       Data Source Manager will allow you to use the Set Filter option on your selected Table

2.       DB Manager will do the same when you highlight the Layer you want to load and click on the SQL Window [cid:image002.png at 01D740CC.14351C50]

3.       Load the Layer in in its entirety, then use the Filter option by right clicking on the layer and selecting Filter.



Whichever of the above you use, the Filtered Layers can be temporally saved out as whatever format you would like while being worked on. This can be achieved by right clicking on the layer, selecting Export => Save Feature As



I Hope that helps in some way.



Regards,



Richard







--
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

--
Oifig na nOibreacha Poibl?
Office of Public Works

Sr?id Jonathan Swift, Baile ?tha Troim, Co na M?, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

--
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/

--
MSc GIS, FME Certified Professional

--
Oifig na nOibreacha Poibl?
Office of Public Works

Sr?id Jonathan Swift, Baile ?tha Troim, Co na M?, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://www.opw.ie

--
Email Disclaimer: https://www.opw.ie/en/disclaimer/

> -----Original Message-----

> From: Qgis-user <qgis-user-bounces at lists.osgeo.org> On Behalf Of Michael

> Gieding

> Sent: 03 May 2021 19:12

> To: QGIS-User Mailinglist <qgis-user at lists.osgeo.org>

> Subject: [Qgis-user] Loading filtered database table as temp layer

>

> Hallo erverybody,

>

> I'm looking for a solution where users can load the output of a sql statement

> from PostgreSQL as temporary layer.

> The tool should be as easy as possible, as the target group is not very

> experienced in QGIS. Means there should be some defined fields to enter

> values for filtering and an ok-button to create the desired layer.

>

> One idea I tried, is to create a workflow in the graphical modelbuilder in

> QGIS. In the moment it works to create a new layer with the desired SQL-

> statement. I used the algorithms "PostgreSQL SQL execute and load" -->

> "Load Layer to project".

> But I can't find an option to load the output of the statement as a temporary.

> The result is like a loaded statement from the database manager. So the

> users would work with the original data within the database.

> Does anyone has got an idea to achieve this? Maybe I've overseen

> something.

>

> Of course a separate plugin would do the thing, but with my skills it's way

> more difficult to achieve.

> So I would be happy to solve the problem the "easy way".

>

> Any (other) hint is welcome.

>

>

> Many thanks in advance.

>

> Michael Gieding

> _______________________________________________

> Qgis-user mailing list

> Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>

> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Please note that the existing 01-6476XXX / 046-9426XXX numbering ranges will no longer be available after 30th April 2021.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210504/1755502d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 419 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210504/1755502d/attachment.png>


More information about the Qgis-user mailing list