r/gis•
ItsAddles

QGIS join attributes with more then one match?

General Question

Hey yall Im working on a project to map out the FCC broadband data to a map with the census blocks. Currently I'm trying to get the map to show on hover the speeds of different provers I have my base google map and I have my census block shapefile and my data set.

The problem that I am running into is each block id has multiple entries that match but it will only use one of them when joining.

IE:

block 123456 would join with 123456 Viasat and 123456 Time Warner but during join it only matched the viasat entry and doesnt add another row with the same data for time warner

So on hover it will only show that viasat is in that census block.

I hope that makes sense this is my first time using any GIS mapping tools and dont know the lingo. thanks

Posted Aug 12, 2022, 6:39 PM UTC

12
ac1dchylde•

You hit a 101 class topic here. I'll give you the terminology and very very basics, you can go from there.

This is called relationships. Between two tables you can have one to one, one to many, many to one, and many to many relationships. You have a one (census block) to many (isp) relationship, at least if you look at in in that direction, or you can flip it around and have a many to one. Many/one is problematic because software is only looking for a single match with most joins (and there are different kinds of joins, but that's another class).

There are different solutions to this. One of the most basic is you duplicate the one for each of the many. Instead of one census block with three isps, you get three copies of the census block with one isp each. Another way is a relate instead of a join. Clicking on the census block pulls up a related table of isps and shows all records with matching criteria, not just one.

I don't know how you'd get this done with on hover. However it's fairly common to have a web map where you click on something and the pop-up has a page arrow/triangle on it with a count, showing that you've actually selected multiple things and allowing you to see the standard pop-up info for each one, one at a time. Your alternative is a change in your data structure, where you 'collapse rows/records' so that you either have as many fields for each block as you do possible isps, or you create an isp field for each block that then combines/lists all the possible matches in that single field (and you can do both, creating the per field version and then concatenating those fields into a single new field). For example: https://gis.stackexchange.com/questions/337573/collapse-rows-with-different-attributes-in-qgis-modeler

2
ItsAddlesOP•

There are different solutions to this. One of the most basic is you duplicate the one for each of the many. Instead of one census block with three isps, you get three copies of the census block with one isp each. Another way is a relate instead of a join. Clicking on the census block pulls up a related table of isps and shows all records with matching criteria, not just one.

Man I have tried since you posted this and I cant seem to get it

1