The orbital angular momentum (OAM) of light and matter waves is a parameter that has been getting increasingly more attention over the past couple of years. Beams with a well-defined OAM, the so-called vortex beams, are applied already in, e.g., telecommunication, astrophysics, nanomanipulation and chiral measurements in optics and electron microscopy. Also, the OAM of a wave induced by the interaction with a sample, has attracted a lot of interest. In all these experiments it is crucial to measure the exact (local) OAM content of the wave, whether it is an incoming vortex beam or an exit wave after interacting with a sample. In this work we investigate the use of spiral phase plates (SPPs) as an alternative to the programmable phase plates used in optics to measure OAM. We derive analytically how these can be used to study the local OAM components of any wave function. By means of numerical simulations we illustrate how the OAM of a pure vortex beam can be measured. We also look at a sum of misaligned vortex beams and show, by using SPPs, the position and the OAM of each individual beam can be detected. Finally, we look at the OAM induced by a magnetic dipole on a free-electron wave and show how the SPP can be used to localize the magnetic poles and measure their "magnetic charge." Although our findings can be applied to study the OAM of any wave function, they are of particular interest for electron microscopy where versatile programmable phase plates do not yet exist.