It seems that there is a lot of confusion here about calculating the position of the sun with respect of the observer.
While the formulas tend to get a bit bulky if you want to do it ârightâ, there is no such thing as âelevation above groundâ. Never. Itâs always elevation with respect to the âgeoidâ or simpler âsea levelâ.
On a smartphone or tablet you donât even need a map for this, as they all have built in GPS. As long as you donât be near an area of military interest, you can rely on that position to about <5m horizontaly and about 10-50m vertically.
You donât even need mobile network access. This works perfectly in open sea and in âairplane modeâ too. You should have a fair share of free sky above you and walking along in NY-City or Grand-Canyon might induce signal echoes that disturb the measurements. Mobile network just might speed up initial satellite fix, as the current trajectories can be fetched over a fast date line instead of decoding the same values from the data broadcasted by the satellites. GPS (and other networks) is a RADIO RECEIVER, utilizing an antenna.
It WILL get complicated, if you want to include the profile of your local horizon to determine, when the sun will climb behind the nearby ridge. This indeed will not only need YOUR 3D coordinates in space, but that of your surrounding too.
There ARE elevation maps that can (and do) be used to calculate that. Results my vary, depending on how thoroughly the country of your position has measured and published these values. Austria for instance has a near perfect elevation map for both ground AND buildings/vegetation. No problem to calculate the time when the sun climbs behind the little forest on the east side of a nearby hill or even the building up there.
You can time it within a second when either upper limb, center or lower limb crosses the line - refraction of the atmosphere included.
But a calculation that does not state what reference it uses, is to be trusted not better than 15 minutes, no matter how many different sources âagreeâ on a value. They may all be wrong. The proof is in the pudding. You might not even get DST correction. Without further notice I would think of âcenter of the sun above mathematical horizon with no air correctionâ. The latter is about a full Sun diameter or 2 minutes in difference that the ârealâ sun is early in the morning and late in the evening compared to âair free earthâ.
I know this, as I am an astronomer and know how to do it. Itâs math, not magic.
If you want the numbers from the penthouse of a sky-scraper, just add the building height to the ground level for your personal âelevationâ - or read the numbers from your smartphone.
No one will ever need elevation above âgroundâ for this. This might be interesting with flying a drone to comply with the regulations, but not for calculating celestial positions.