Thursday, 11 February 2016

qgis - Selecting through one-to-many relationship


I'm trying to make a species distribution project where I can select a species from a non-spatial list of species and the selection would highlight (select) all the counties to which the species has been attributed.


Simplified example data:
species, a non-spatial table of species (CSV with header):
"species"

"Mus borealis"
"Mus australis"


species_distributions, a non-spatial relation table (csv with header):
"species","county"
"Mus borealis","North"
"Mus borealis","Central"
"Mus australis","South"
"Mus australis","Central"


counties, a spatial feature class representing county boundaries (first row = field name):
"county"

"North"
"South"
"Central"
"West"


So if I select "Mus borealis" from the species table, the "North" and "Central" counties would be highlighted in the map. Seems like a simple scenario, but I have been unable to uncover a solution on my own. The closest I've found is a plugin "Select by relationship" but it doesn't appear to be available for QGIS 3 (I'm using QGIS 3.4.3). I have a PostGIS server available.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...