Geonad

From Geohashing
Revision as of 17:22, 25 June 2008 by imported>Hermann (New page: {{quote|right|No matter how close you've come, you will never get exactly there.|Variation of Murphy's Law}} The Geonad is the distance between a hasher and the geohash at the point of tim...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
No matter how close you've come, you will never get exactly there.
Variation of Murphy's Law

The Geonad is the distance between a hasher and the geohash at the point of time the geohasher finds that (s)he is close enough. If you can determine the Geonad using a measuring tape, you are very lucky. Other people can probably use a map or ask their portable GPS devices, if it has that feature.

"manual" Geonad determination

Where are we?
We are about here...
And where is the hash?
These are the coordinates...
So how far is it from here to the hash?
It's... Hmm. Interesting. Maybe if you start with... No. Wait. Hmm... You could...
--Felix and Hermann on the way to a geohash.

Hermann then wrote this tool running on his smartphone with PythonCE:

'''Note: The earth IS a sphere.'''
import math
'''Get locations'''
input = raw_input("please enter lat lon lat lon: ")
try:
 input = input.split(" ")
 tlat = math.radians(float(input[0]))
 tlon = math.radians(float(input[1]))
 alat = math.radians(float(input[2]))
 alon = math.radians(float(input[3]))
except:
 print "invalid input"
 exit(1)
'''convert geographic coordinates into vectors'''
tx = math.cos(tlat)*math.cos(tlon)
ty = math.cos(tlat)*math.sin(tlon)
tz = math.sin(tlat)
ax = math.cos(alat)*math.cos(alon)
ay = math.cos(alat)*math.sin(alon)
az = math.sin(alat)
'''determine angle between vectors'''
nada = math.acos(tx*ax+ty*ay+tz*az)
'''print distance on surface*'''
raw_input("%f km" % (6378.1*nada))

Definition of Nad

Nad (n.)
Measure defined as the distance between a driver's outstretched fingertips and the ticket machine in an automatic car-park.
1 nad = 18.4 cm
--Definition of "Nad" in Douglas Adams` The Deeper Meaning of Liff