Feebs something else to consider. Was any electrical work carried out in the bathroom such as shaver or toothbrush socket, new lights, electric shower? If so this work needs a certificate to be legal. Also having had a second look at the picture, is the 4 inch waste pipe connected to the rain gutter? Is this a new bathroom? Has some idiot connected a foul water outlet to a rainwater soak away?
I'd say the 4" pipe steps out over the gutter with a pair of 45's and vents to atmosphere
Could well be wrong though