Shock waves, dead zones and particle-free regions form when a thin surface avalanche of granular material flows around an obstacle or over a change in the bed topography. Understanding and modelling these flows is of considerable practical interest for industrial processes, as well as for the design of defences to protect buildings, structures and people from snow avalanches, debris flows and rockfalls. These flow phenomena also yield useful constitutive information that can be used to improve existing avalanche models. In this paper a simple hydraulic theory, first suggested in the Russian literature, is generalized to model quasi-two-dimensional flows around obstacles. Exact and numerical solutions are then compared with laboratory experiments. These indicate that the theory is adequate to quantitatively describe the formation of normal shocks, oblique shocks, dead zones and granular vacua. Such features are generated by the flow around a pyramidal obstacle, which is typical of some of the defensive structures in use today.