"how would you figure agl in hilly country ?"
Basically, the same way a surveyor would. Base your calculations on a known point. Then it's strictly a matter of how exact those measurements are.
If you're going to use a GPS, which isn't exactly all that accurate, then the 'best', or most practical method is by finding the average of several readings. Won't be very accurate, but more accurate than guessing probably.
Or, the same way it's commonly done, use a very accurate altimeter and barometer. Again, not the most accurate method in the world, but more accurate than you might think. (Never inches, seldom feet, mostly yards, if that. And strictly a matter of how accurate that reference point is.)
Somebody always has to do it the 'hard way'. Then it's just a matter of finding/using those results to find out what you particularly want.
- 'Doc