not everyone lives in streets/towns/cities or even villages. The last time I lived in a town, I was at uni 20 odd years ago... since then I have usually had no neighbours, lived as rural as you can get, frequently been off mains water/sewage/gas & no TV signal at all and had intermittant electricty... Shopping trips were half day expeditions completed once every 2 weeks, or a month and if you forgot to buy it, you did without. I also grew up in a rural location, until I was 8 years old, though slightly less rural than now.
So - put into perspective, I am talking about city folk or town folk who come out into the countryside to allow their dogs to walk off lead, whilst they chat either to phone or more often with each other. they pay no attention whatsoever to what is going on around them, their dogs or nature in general & are completely in awe of 'white blobs' in the fields called sheep! they frequently walk 2/3/4 a breast, so it is easier to talk with/at each other and are completely unaware of anyone other than themselves. Saying excuse me to get their attention, rather than barging between them when they are completely blocking the path/track seems positively polite to me given their inconsiderate use of the bridgeway/tracks/footpaths. The slighest recongition of that fact that they are not the only people in the world would be a good place to start. We have even had the situation where so engrossed in their own conversations, that they have walked into our stationary bikes, patiently waiting for them to even see us coming towards them. It has not been unknown for us to have to make our presence known when we are on foot to avoid any incident. Extreme example - no, I get it each and every day simply because I live in what townies perceive as their leisure area aka 'the countryside'.
so streets, no; shouting, no, not normally; calling out politely, yes; at pedestrains, yes; on my bike, yes; on foot, yes; justified, as the need arises & yes. Not every spoken word with a stranger has to be rude.