During the evening of 19th October I headed from Bologna to home in San Benedetto Val di Sambro….. A journey so familiar yet made unusual by the frequent stops in the train track (due to weather conditions). I got down at my stop well over 30 minutes after the scheduled time to meet a rain so intense that evoked memories of monsoon in Bangladesh….. The bus to take me to the top of the mountain was nowhere to be seen and SURELY no soul would venture outside in this inclement weather. I could only wait with trepidation but eventually took a train back to bologna where the clouds could muster only a drizzle!! (I was very fortunate to have a place to spend the night in Bologna)
In the following days San Benedetto is battered by landslides…. Fortunately, there is no casualties or significant loss of property, only few homes are evacuated as precaution. A San Benedetto Val di Sambro si è riattivata una grande frana di 30 anni fa →
At any rate I came across the rainfall data by the comune of Bologna and thought to do some analysis guided by the question whether the rainfall has actually increased (I remember in past years when lessons in person were cancelled due to heavy rainfall)…. Well it seems outlier rainfall hasn't really increased? I thought to utilize this opportunity to build a R Shiny on top of my analysis too
TBH I do not know the answer for San Benedetto yet….it may as well be that if the outlier rainfall hasn't really changed in bologna it hasn't so in San Benedetto too…Idk…. Sometimes I can have 8 cm of snow outside my house and none in the train station several hundred metres down!
Methodology
- Monthly medians to represent typical rainfall patterns
- Outlier events using the Interquartile Range (IQR = Q3 – Q1) method and defining outliers as any rainfall amount above Q3 + 1.5 × IQR
- Seasonal averages calculated by grouping months into meteorological seasons
The data should update regularly (with the comune di Bologna's site)
Slider to visualize different years
API endpoint: https://opendata.comune.bologna.it/api/explore/v2.1/catalog/datasets/precipitazioni_bologna/records?limit=20 Original data source →Notes to self
- The "records" endpoint on the Bologna portal only let someone retrieve a maximum of 100 rows.
Solution: I switched to the "exports" endpoint (CSV download) which has no limit on the number of rows, letting me pull the entire dataset at once. - Initially, read.csv() returned a single column like "date.184_avg_d.stagione", (meaning the file wasn't being split properly???)
Solution: I discovered the CSV actually used semicolon separators (sep=";")