[Qgis-user] Relations capabilities

Bernhard Ströbl bernhard.stroebl at jena.de
Tue Feb 23 23:09:48 PST 2016


Hi Brent,

not sure if I uttered that before, so (if I did) my apologies for 
repeating myself. If you are entirely on PostgreSQL you may try my 
Plugin DataDrivenInputMask [1]. If you have properly defined foreign 
keys you can
1) see the species caught in one station in a list [2]
2) search for (and thus select) stations where certain species have been 
caught
I assume
a) a station table with pk field station_pk
b) a species table with pk field species_pk
c) a relation table with a combined pk = station_pk + species_pk, where 
station_pk is a fk on station.station_pk and species_pk is a fk on 
species.species_pk

Regarding symbology you may filter your station layer like that:
station_pk IN (SELECT station_pk FROM relation_table where species_pk = 
some_value)
You would need to load your station layer several times and filter each 
of them on one (or several) species for symbolization.

Another way would be to use PostgreSQL's crosstab extension and create a 
view for symbolization only which would list all the species in one 
dataset like that
station_pk, geom, station_name, species_1, species_2,...,species_n
You could then classify on the combinations

Bernhard

[1] http://plugins.qgis.org/plugins/DataDrivenInputMask/
[2] 
https://github.com/bstroebl/DataDrivenInputMask/wiki/Widgets-for-n-2-m-Relations

Am 24.02.2016 um 02:16 schrieb Brent Wood:
> Firstly, thanks to those who already helped me with this.
> I have established a relation between non-spatial catch records in a postgis table and a table of station information (linked via foreign key).
> If I click on a station with the info tool, I can see the various catch records from that station - so the relation is working.
> But that seems to be it. If I filter on the species in the catch, that only applies to the catch data showing up when I select a station - it does NOT hide stations where that species was not caught. I cannot change symbology based on a relation, I cannot select features based on a relation - all I can do is view the records - and with 70 fields in the station layer, the catch records are just a small window at the bottom of the form.
> It seems that to be useful I need to create the view or table in the database & access this with QGIS - whioch has issues for users without create access in the database - which is most of them.
> Is work on this area (relations) of QGIS actively ongoing, or should I look for non-QGIS approaches?
> Thanks,
>    Brent Wood
>
>
>
>
> __________ Information from ESET Mail Security, version of virus signature database 13076 (20160223) __________
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
>
>
> Firstly, thanks to those who already helped me with this.
>
> I have established a relation between non-spatial catch records in a
> postgis table and a table of station information (linked via foreign key).
>
> If I click on a station with the info tool, I can see the various catch
> records from that station - so the relation is working.
>
> But that seems to be it. If I filter on the species in the catch, that
> only applies to the catch data showing up when I select a station - it
> does NOT hide stations where that species was not caught. I cannot
> change symbology based on a relation, I cannot select features based on
> a relation - all I can do is view the records - and with 70 fields in
> the station layer, the catch records are just a small window at the
> bottom of the form.
>
> It seems that to be useful I need to create the view or table in the
> database & access this with QGIS - whioch has issues for users without
> create access in the database - which is most of them.
>
> Is work on this area (relations) of QGIS actively ongoing, or should I
> look for non-QGIS approaches?
>
> Thanks,
>
>    Brent Wood
>
>
>
>
> __________ Information from ESET Mail Security, version of virus
> signature database 13076 (20160223) __________
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>



__________ Information from ESET Mail Security, version of virus signature database 13077 (20160224) __________

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





More information about the Qgis-user mailing list