Using many-to-one relationship in QGIS

91 views
Skip to first unread message

Chavdar Kirilov

unread,
Mar 7, 2023, 6:11:03 PM3/7/23
to QGIS Australia User Group
Hello, I'm a newbie here and also not very experienced with QGIS.

My goal is to visualize the changing "geography of death" of the Roman emperors over time. The essential available data is the year of death (AD) and the place of death, with the places of death in some cases being duplicated since different emperors died in the exact same place, e.g. Rome. What I have been unsuccessfully trying to achieve is to create a map that reflects two things simultaneously:

1) The points of the places of death are to be classified by size according to the number of deaths in each.
2) The points of the places of death are to be visualized differently depending on the century in which the death occurred, i.e. to group the unique values (years of death) within periods, in this case, centuries.

Any help would be appreciated!

Attached is a screenshot of a part of my attribute table as well as the .csv-file
  romanemperorsdeaths.png
romanemperordeaths.csv

Emma Hain

unread,
Mar 8, 2023, 6:30:55 AM3/8/23
to QGIS Australia User Group
Hi
Welcome to the group! 

1) size depending on number of deaths in location 

2) group according to century
- duplicate the layers and filter the data according to century - then do the heatmap 

Other options
You can manually do it as well by creating another dataset based on location for problem 1 with a value of the century and a count ofb occurances next to it. 

Create a virtual later

I'm sure the community has other ways of doing it. 

Let us know how you go! 

Cheers
Em

--
You received this message because you are subscribed to the Google Groups "QGIS Australia User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to australian-qgis-use...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/australian-qgis-user-group/4703ac64-0045-4eb6-a5f5-fb31981168e3n%40googlegroups.com.

Jasmine Lee

unread,
Mar 10, 2023, 12:07:47 AM3/10/23
to QGIS Australia User Group
Hi Chavdar, 

Welcome to the the group and I'm so excited you are keen on QGIS! 

I would visualise it like the image below and here are the steps. Warning, it requires some calculate fields that may be a bit more on the intermediate level. These are the following steps: 

1. Load the data into QGIS
2. In the field calculator put in the following expression for a new field (note "Place ot death" field is what it is called in your attached file: 
     array_count( array_agg(  "Place ot death" ,group_by:= "Place ot death" ), "Place ot death" )
     What the calculation does is find where the same string for "place ot death" and counts if that exists. 
3. In the size area there is a symbol like this: Screenshot 2023-03-09 174758.png Click on it
     Screenshot 2023-03-09 174856.png
4. Go to edit and then fill in an expression. The expression below is saying that if the count of deaths is 1 then make the point size as 3 etc. That's how you end up with your points being in different sizes
Screenshot 2023-03-09 175006.png
5. To colour the dots, I just used Graduated, select Year of death as the value and classified it into equal count. You can change this depending on what you are after. 
Screenshot 2023-03-09 175249.png
You should now have the image below. 

You will need a legend to communicate what the size and colours mean. The map let's the viewer understand the size means how many deaths and the colours provide a time reference. 

This is one way to do it. Hope it helps. 

visualising data.png

Kind regards

Nhung Seidensticker 

Chavdar Kirilov

unread,
Mar 10, 2023, 3:05:16 AM3/10/23
to QGIS Australia User Group
WOW, this is brilliant, exactly what I needed! I was sure it was me, and not QGIS :)
Thank you so much!
Below my own result following your instructions (meanwhile I extended the list to the end of the 6th century).
Cheers from Bulgaria and thank you again!
Chavdar

Screenshot from 2023-03-10 09-57-06.png

Jasmine Lee

unread,
Mar 10, 2023, 3:27:41 AM3/10/23
to QGIS Australia User Group
Hi Chavdar, 

This is amazing! I'm so glad that the instructions provided you with what you needed. I love the use of the physical base map and the centuries that you used. 

Cheers from Melbourne, Australia. 

Nhung 
Reply all
Reply to author
Forward
0 new messages