[Qgis-user] Joining Postgis tables in QGIS ?

Brent Wood pcreso at pcreso.com
Tue Sep 10 15:00:19 PDT 2013



I'm wondering if there is a way to join aspatial Postgis tables to spatial ones in QGIS.

Target scenario: 

a spatial table of site locations

a table of species observations at each location.

In Postgis I can (obviously) create a view joining these two tables on location_id.

However, this means that if I have 40 species observed at a location, I get 40 copies of the same point, each with one species. This is NOT what I want.

What I want to do is retain the one point representing the location, but when clicking on it, retrieve the 40 species that have the ID. 

I had a brief try at running this as an action, passing in the required parameters to psql, but getting a passworded connection to work from the command line, & escaping all the embedded quotes put this in the too
 hard basket. Maybe run it via a shell script? This is also likely to be feasible for me running Linux, but more problematic under Windows (most other users), and not a simple, generic solution. 

Is there a way to implement such a join (link?) in QGIS? Ideally using multiple attributes, just to make it more complicated :-)


Thanks,

  Brent Wood
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130910/0d699334/attachment.html>


More information about the Qgis-user mailing list