Hi, I would like to post my opinion in this topic
Basically you have two options when using gps with barometric values,
1. automatic calibration (like garmin mentioned above)
2. manual - you have manully enter pressure at sea level or altitude
To get ideas you can check SportyPal software where it is already implemented. But I prefer manual setting where recalibration takes effect only when user wants. In hiking it is not changed too often as area and period where pressure changes are not too big. But in aviation terms, there are changes more common
Basically there are
3 values with 1 user input, 1 measured and 1 computed values1. local pressure (measured value taken by sensor) (QFE in aviation terminology)
2. pressure at sea level (QNH)
3. altitude
(either 2. or 3. serve as an input the other one is then calculated)
In hiking most common approach is to set 3. as input then you are able to compute QNH (2) and then every change in pressure correspond to offset change in altitude. (e.g. suunto watches are using this method, altitude is taken from known points/landmarks etc)
In aviation most common approach is to set 2. as input then you are able to compute present altitude and then changes in pressure correspond to offset change in altitude ( QNH value is available in weather METAR messages for every airport or by tower when flying to different area - woudl be usefull to change during flight/track easily. Btw. flying above so called "transition altitude" (often 8000ft) requires all planes/glider to set QNH to 1013 - in aviation, pressure altitude ALWAYS takes precendence over GPS altitude, so manual setting would be welcome.
calculations can be taken from this page as resource
http://www.hochwarth.com/misc/AviationCalculator.html (first part regarding QNH/QFE) or if exact equation is necessary let me know, but it is inside JavaScript on that page